6798822: (process) Non-portable use of isdigit in src/solaris/native/java/lang/UNIXProcess_md.c
Reviewed-by: alanb
Contributed-by: christos@zoulas.com
--- 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);
}