提交 68945ef0 编写于 作者: M martin

6798822: (process) Non-portable use of isdigit in src/solaris/native/java/lang/UNIXProcess_md.c

Reviewed-by: alanb
Contributed-by: christos@zoulas.com
上级 e7d57f53
......@@ -259,6 +259,12 @@ Java_java_lang_UNIXProcess_waitForProcessExit(JNIEnv* env,
}
}
static int
isAsciiDigit(char c)
{
return c >= '0' && c <= '9';
}
static int
closeDescriptors(void)
{
......@@ -284,7 +290,7 @@ closeDescriptors(void)
*/
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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册