opal/util: improve error message in opal_os_dirpath_create()
Этот коммит содержится в:
родитель
4b47daeeb0
Коммит
e6f7facd7d
@ -66,8 +66,8 @@ int opal_os_dirpath_create(const char *path, const mode_t mode)
|
|||||||
}
|
}
|
||||||
opal_output(0,
|
opal_output(0,
|
||||||
"opal_os_dirpath_create: "
|
"opal_os_dirpath_create: "
|
||||||
"Error: Unable to create directory (%s), unable to set the correct mode [%d]\n",
|
"Error: Unable to create directory (%s), unable to set the correct mode [%d] (%s)\n",
|
||||||
path, ret);
|
path, errno, strerror(errno));
|
||||||
return(OPAL_ERR_PERM); /* can't set correct mode */
|
return(OPAL_ERR_PERM); /* can't set correct mode */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,10 +117,15 @@ int opal_os_dirpath_create(const char *path, const mode_t mode)
|
|||||||
Create it if it doesn't exist. */
|
Create it if it doesn't exist. */
|
||||||
ret = mkdir(tmp, mode);
|
ret = mkdir(tmp, mode);
|
||||||
if ((0 > ret && EEXIST != errno) || 0 != stat(tmp, &buf)) {
|
if ((0 > ret && EEXIST != errno) || 0 != stat(tmp, &buf)) {
|
||||||
opal_output(0,
|
if (0 > ret && EEXIST != errno) {
|
||||||
"opal_os_dirpath_create: "
|
opal_output(0, "opal_os_dirpath_create: "
|
||||||
"Error: Unable to create the sub-directory (%s) of (%s), mkdir failed [%d]\n",
|
"Error: Unable to create the sub-directory (%s) of (%s), mkdir failed [%d] (%s)]\n",
|
||||||
tmp, path, ret);
|
tmp, path, errno, strerror(errno));
|
||||||
|
} else {
|
||||||
|
opal_output(0, "opal_os_dirpath_create: "
|
||||||
|
"Error: Unable to stat the sub-directory (%s) of (%s), mkdir failed [%d] (%s)]\n",
|
||||||
|
tmp, path, errno, strerror(errno));
|
||||||
|
}
|
||||||
opal_argv_free(parts);
|
opal_argv_free(parts);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
return OPAL_ERROR;
|
return OPAL_ERROR;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user