1
1

Eliminate malloc by utilizing /proc/self/fd - optimization

Этот коммит содержится в:
Ralph Castain 2015-09-22 07:24:54 -07:00
родитель a9fc53cf20
Коммит f28448702a

Просмотреть файл

@ -359,14 +359,7 @@ static void send_error_show_help(int fd, int exit_status,
the parent. */
static int close_open_file_descriptors(int write_fd,
orte_iof_base_io_conf_t opts) {
int pid = getpid();
char *fds_dir = NULL;
int rc = asprintf(&fds_dir, "/proc/%d/fd", pid);
if (rc < 0) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
DIR *dir = opendir(fds_dir);
free(fds_dir);
DIR *dir = opendir("/proc/self/fd");
if (NULL == dir) {
return ORTE_ERR_FILE_OPEN_FAILURE;
}