Skip to content

Commit 867c841

Browse files
author
Ralph Castain
committed
Quick fix: save the errno from the mkdir call as the call to stat will likely overwrite it
Signed-off-by: Ralph Castain <[email protected]> (cherry picked from commit 6da4dbb)
1 parent c722fb9 commit 867c841

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

opal/util/os_dirpath.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ int opal_os_dirpath_create(const char *path, const mode_t mode)
113113
}
114114

115115
/* Now that we have the name, try to create it */
116-
ret = mkdir(tmp, mode);
116+
mkdir(tmp, mode);
117+
ret = errno; // save the errno for an error msg, if needed
117118
if (0 != stat(tmp, &buf)) {
118119
opal_show_help("help-opal-util.txt", "mkdir-failed", true,
119-
tmp, strerror(errno));
120+
tmp, strerror(ret));
120121
opal_argv_free(parts);
121122
free(tmp);
122123
return OPAL_ERROR;

0 commit comments

Comments
 (0)