src/java.base/unix/native/libjava/childproc.c
changeset 51597 4c78f4fd8370
parent 47216 71c04702a3d5
child 55218 412ce076c0dc
child 58678 9cf78a70fa4f
--- a/src/java.base/unix/native/libjava/childproc.c	Thu Aug 30 11:53:49 2018 -0700
+++ b/src/java.base/unix/native/libjava/childproc.c	Thu Aug 30 12:39:26 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,12 +66,12 @@
   /* AIX does not understand '/proc/self' - it requires the real process ID */
   #define FD_DIR aix_fd_dir
   #define DIR DIR64
+  #define dirent dirent64
   #define opendir opendir64
+  #define readdir readdir64
   #define closedir closedir64
 #elif defined(_ALLBSD_SOURCE)
   #define FD_DIR "/dev/fd"
-  #define dirent64 dirent
-  #define readdir64 readdir
 #else
   #define FD_DIR "/proc/self/fd"
 #endif
@@ -80,7 +80,7 @@
 closeDescriptors(void)
 {
     DIR *dp;
-    struct dirent64 *dirp;
+    struct dirent *dirp;
     int from_fd = FAIL_FILENO + 1;
 
     /* We're trying to close all file descriptors, but opendir() might
@@ -102,10 +102,7 @@
     if ((dp = opendir(FD_DIR)) == NULL)
         return 0;
 
-    /* We use readdir64 instead of readdir to work around Solaris bug
-     * 6395699: /proc/self/fd fails to report file descriptors >= 1024 on Solaris 9
-     */
-    while ((dirp = readdir64(dp)) != NULL) {
+    while ((dirp = readdir(dp)) != NULL) {
         int fd;
         if (isAsciiDigit(dirp->d_name[0]) &&
             (fd = strtol(dirp->d_name, NULL, 10)) >= from_fd + 2)