1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-30 10:38:37 +00:00

. Sync the BSD specific code with the changes between 1.5 and 1.6 and

start closing file descriptors at FAIL_FILENO + 1 rather than 3.  This
  fixes the problem with determining the exit code for exec()'ed processes.

PR:		115557
Submitted by:	Michiel Boland <michiel@boland.org>
This commit is contained in:
Greg Lewis 2007-08-28 15:24:32 +00:00
parent 77c1dd6440
commit 1d3ef52383
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=198454
2 changed files with 32 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= jdk
PORTVERSION= ${JDK_VERSION}.${JDK_UPDATE_VERSION}p${JDK_PATCHSET_VERSION}
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= java devel
MASTER_SITES= # http://download.java.net/jdk6/
# http://www.eyesbeyond.com/freebsddom/java/jdk16.html

View File

@ -0,0 +1,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