--- old/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c 2018-07-16 17:38:58.000000000 -0700 +++ new/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c 2018-07-16 17:38:57.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -74,20 +74,6 @@ #endif /* _ALLBSD_SOURCE */ -static struct dirent* read_dir(DIR* dirp, struct dirent* entry) { -#ifdef __solaris__ - struct dirent* dbuf = readdir(dirp); - return dbuf; -#else /* __linux__ || _ALLBSD_SOURCE */ - struct dirent* p; - if (readdir_r(dirp, entry, &p) == 0) { - return p; - } else { - return NULL; - } -#endif -} - // true = get available swap in bytes // false = get total swap in bytes static jlong get_total_or_available_swap_space_size(JNIEnv* env, jboolean available) { @@ -432,7 +418,6 @@ return (100); #else /* solaris/linux */ DIR *dirp; - struct dirent dbuf; struct dirent* dentp; jlong fds = 0; @@ -453,7 +438,7 @@ // iterate through directory entries, skipping '.' and '..' // each entry represents an open file descriptor. - while ((dentp = read_dir(dirp, &dbuf)) != NULL) { + while ((dentp = readdir(dirp)) != NULL) { if (isdigit(dentp->d_name[0])) { fds++; }