blob: 6c5d4aa41200d2fc35aa688b8c6ff9021c23cb5c (
plain) (
blame)
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
|
$FreeBSD$
--- ../../j2se/src/solaris/native/java/lang/UNIXProcess_md.c 13 Aug 2007 21:37:38 -0000 1.4
+++ ../../j2se/src/solaris/native/java/lang/UNIXProcess_md.c 28 Aug 2007 06:36:09 -0000
@@ -264,7 +264,7 @@
static int
closeDescriptors(void)
{
- return _thread_sys_closefrom(3);
+ return _thread_sys_closefrom(FAIL_FILENO + 1);
}
#elif defined(_ALLBSD_SOURCE)
@@ -282,7 +282,7 @@
/*
* BSDNOTE: There's no known way to find list of all open file descriptors
* associated with process in FreeBSD. Therefore we have to pass from
- * fd == 3 to maximum fd per process number. It's possible to retrive
+ * fd == FAIL_FILENO + 1 to maximum fd per process number. It's possible to retrive
* max number of fd's with three ways: sysctl(kern.maxfilesperproc),
* getrlimit(RLIMIT_NOFILE) and getdtablesize(). In current implementation
* getdtablesize() returns MIN() of first two ways.
@@ -297,7 +297,7 @@
max_fd = getdtablesize();
ebadf = 0;
- for (i = 3; i < max_fd; i++) {
+ for (i = FAIL_FILENO + 1; i < max_fd; i++) {
if (close(i) < 0) { ebadf++; } else { ebadf = 0; }
/*
* GUESS_FINISHED subsequent calls to close() returned EBADF, assume
|