6798822: (process) Non-portable use of isdigit in src/solaris/native/java/lang/UNIXProcess_md.c
authormartin
Wed, 28 Jan 2009 14:13:37 -0800
changeset 1936 66e7f98f4dde
parent 1935 4010e03f8c1c
child 1937 28c31d4a9597
6798822: (process) Non-portable use of isdigit in src/solaris/native/java/lang/UNIXProcess_md.c Reviewed-by: alanb Contributed-by: christos@zoulas.com
jdk/src/solaris/native/java/lang/UNIXProcess_md.c
--- a/jdk/src/solaris/native/java/lang/UNIXProcess_md.c	Wed Jan 28 12:46:43 2009 -0800
+++ b/jdk/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);
     }