< prev index next >

src/hotspot/os/linux/perfMemory_linux.cpp

Print this page

        

*** 560,572 **** // open the directory and check if the file for the given vmid or nspid exists. // The file with the expected name and the latest creation date is used // to determine the user name for the process id. // struct dirent* dentry; - char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal); errno = 0; ! while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) { // check if the directory entry is a hsperfdata file if (strncmp(dentry->d_name, PERFDATA_NAME, strlen(PERFDATA_NAME)) != 0) { continue; } --- 560,571 ---- // open the directory and check if the file for the given vmid or nspid exists. // The file with the expected name and the latest creation date is used // to determine the user name for the process id. // struct dirent* dentry; errno = 0; ! while ((dentry = os::readdir(tmpdirp, NULL)) != NULL) { // check if the directory entry is a hsperfdata file if (strncmp(dentry->d_name, PERFDATA_NAME, strlen(PERFDATA_NAME)) != 0) { continue; }
*** 596,608 **** os::closedir(subdirp); continue; } struct dirent* udentry; - char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal); errno = 0; ! while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) { if (filename_to_pid(udentry->d_name) == searchpid) { struct stat statbuf; int result; --- 595,606 ---- os::closedir(subdirp); continue; } struct dirent* udentry; errno = 0; ! while ((udentry = os::readdir(subdirp, NULL)) != NULL) { if (filename_to_pid(udentry->d_name) == searchpid) { struct stat statbuf; int result;
*** 642,656 **** FREE_C_HEAP_ARRAY(char, filename); } } os::closedir(subdirp); - FREE_C_HEAP_ARRAY(char, udbuf); FREE_C_HEAP_ARRAY(char, usrdir_name); } os::closedir(tmpdirp); - FREE_C_HEAP_ARRAY(char, tdbuf); return(oldest_user); } // Determine if the vmid is the parent pid --- 640,652 ----
*** 768,781 **** // remove or create new files in this directory. The behavior of this // loop under these conditions is dependent upon the implementation of // opendir/readdir. // struct dirent* entry; - char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal); errno = 0; ! while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) { pid_t pid = filename_to_pid(entry->d_name); if (pid == 0) { --- 764,776 ---- // remove or create new files in this directory. The behavior of this // loop under these conditions is dependent upon the implementation of // opendir/readdir. // struct dirent* entry; errno = 0; ! while ((entry = os::readdir(dirp, NULL)) != NULL) { pid_t pid = filename_to_pid(entry->d_name); if (pid == 0) {
*** 808,819 **** errno = 0; } // close the directory and reset the current working directory close_directory_secure_cwd(dirp, saved_cwd_fd); - - FREE_C_HEAP_ARRAY(char, dbuf); } // make the user specific temporary directory. Returns true if // the directory exists and is secure upon return. Returns false // if the directory exists but is either a symlink, is otherwise --- 803,812 ----
< prev index next >