changeset 844:6607850bd7fc

6798822: (process) Non-portable use of isdigit in src/solaris/native/java/lang/UNIXProcess_md.c Reviewed-by: alanb Contributed-by: christos@zoulas.com
author martin
date Wed, 28 Jan 2009 14:13:37 -0800
parents 1ebbc958f06a
children 7241bd422542
files src/solaris/native/java/lang/UNIXProcess_md.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/lang/UNIXProcess_md.c	Wed Jan 28 12:46:43 2009 -0800
+++ b/src/solaris/native/java/lang/UNIXProcess_md.c	Wed Jan 28 14:13:37 2009 -0800
@@ -260,6 +260,12 @@
 }
 
 static int
+isAsciiDigit(char c)
+{
+  return c >= '0' && c <= '9';
+}
+
+static int
 closeDescriptors(void)
 {
     DIR *dp;
@@ -284,7 +290,7 @@
      */
     while ((dirp = readdir64(dp)) != NULL) {
         int fd;
-        if (isdigit(dirp->d_name[0]) &&
+        if (isAsciiDigit(dirp->d_name[0]) &&
             (fd = strtol(dirp->d_name, NULL, 10)) >= from_fd + 2)
             close(fd);
     }