blob: 3c6cc31c1bc38936e1ca705e7d4dba429bea2fc7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
$NetBSD: patch-ab,v 1.3 2007/09/23 11:42:43 jlam Exp $
--- liblock/lockdaemon.c.orig 2007-05-04 23:04:41.000000000 -0400
+++ liblock/lockdaemon.c
@@ -8,4 +8,5 @@
#include <stdio.h>
#include <signal.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
@@ -31,4 +32,8 @@
#endif
+#ifndef OPEN_MAX
+#define OPEN_MAX 64
+#endif
+
#define exit(_a_) _exit(_a_)
@@ -146,5 +151,5 @@ int lockfd;
}
- if (lockfd < 0 || dup2(lockfd, 99) != 99)
+ if (lockfd < 0 || dup2(lockfd, OPEN_MAX-1) != OPEN_MAX-1)
{
perror(lockfile);
@@ -153,5 +158,5 @@ int lockfd;
close(lockfd);
- lockfd=99;
+ lockfd=OPEN_MAX-1;
#ifdef FD_CLOEXEC
|