From 6da4dbbb333b03b978188b7ff0b45f39f3f9db21 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 18 Jan 2017 15:42:31 -0800 Subject: [PATCH] Quick fix: save the errno from the mkdir call as the call to stat will likely overwrite it Signed-off-by: Ralph Castain --- opal/util/os_dirpath.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opal/util/os_dirpath.c b/opal/util/os_dirpath.c index ff25eb7d2c..9ef9ebb96b 100644 --- a/opal/util/os_dirpath.c +++ b/opal/util/os_dirpath.c @@ -113,10 +113,11 @@ int opal_os_dirpath_create(const char *path, const mode_t mode) } /* Now that we have the name, try to create it */ - ret = mkdir(tmp, mode); + mkdir(tmp, mode); + ret = errno; // save the errno for an error msg, if needed if (0 != stat(tmp, &buf)) { opal_show_help("help-opal-util.txt", "mkdir-failed", true, - tmp, strerror(errno)); + tmp, strerror(ret)); opal_argv_free(parts); free(tmp); return OPAL_ERROR;