mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
libzfs: use zfs_strerror() in place of strerror()
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Richard Kojedzinszky <richard@kojedz.in> Closes #15793
This commit is contained in:
committed by
Brian Behlendorf
parent
692f0daba3
commit
401c3563d4
@@ -1290,7 +1290,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
|
||||
if (error == ENOENT)
|
||||
return (0);
|
||||
|
||||
zutil_error_aux(hdl, "%s", strerror(error));
|
||||
zutil_error_aux(hdl, "%s", zfs_strerror(error));
|
||||
(void) zutil_error_fmt(hdl, LPC_BADPATH, dgettext(TEXT_DOMAIN,
|
||||
"cannot resolve path '%s'"), dir);
|
||||
return (error);
|
||||
@@ -1299,7 +1299,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
|
||||
dirp = opendir(path);
|
||||
if (dirp == NULL) {
|
||||
error = errno;
|
||||
zutil_error_aux(hdl, "%s", strerror(error));
|
||||
zutil_error_aux(hdl, "%s", zfs_strerror(error));
|
||||
(void) zutil_error_fmt(hdl, LPC_BADPATH, dgettext(TEXT_DOMAIN,
|
||||
"cannot open '%s'"), path);
|
||||
return (error);
|
||||
@@ -1361,7 +1361,7 @@ zpool_find_import_scan_path(libpc_handle_t *hdl, pthread_mutex_t *lock,
|
||||
goto out;
|
||||
}
|
||||
|
||||
zutil_error_aux(hdl, "%s", strerror(error));
|
||||
zutil_error_aux(hdl, "%s", zfs_strerror(error));
|
||||
(void) zutil_error_fmt(hdl, LPC_BADPATH, dgettext(TEXT_DOMAIN,
|
||||
"cannot resolve path '%s'"), dir);
|
||||
goto out;
|
||||
@@ -1399,7 +1399,7 @@ zpool_find_import_scan(libpc_handle_t *hdl, pthread_mutex_t *lock,
|
||||
if (error == ENOENT)
|
||||
continue;
|
||||
|
||||
zutil_error_aux(hdl, "%s", strerror(error));
|
||||
zutil_error_aux(hdl, "%s", zfs_strerror(error));
|
||||
(void) zutil_error_fmt(hdl, LPC_BADPATH, dgettext(
|
||||
TEXT_DOMAIN, "cannot resolve path '%s'"), dir[i]);
|
||||
goto error;
|
||||
@@ -1629,14 +1629,14 @@ zpool_find_import_cached(libpc_handle_t *hdl, importargs_t *iarg)
|
||||
verify(iarg->poolname == NULL || iarg->guid == 0);
|
||||
|
||||
if ((fd = open(iarg->cachefile, O_RDONLY | O_CLOEXEC)) < 0) {
|
||||
zutil_error_aux(hdl, "%s", strerror(errno));
|
||||
zutil_error_aux(hdl, "%s", zfs_strerror(errno));
|
||||
(void) zutil_error(hdl, LPC_BADCACHE, dgettext(TEXT_DOMAIN,
|
||||
"failed to open cache file"));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (fstat64(fd, &statbuf) != 0) {
|
||||
zutil_error_aux(hdl, "%s", strerror(errno));
|
||||
zutil_error_aux(hdl, "%s", zfs_strerror(errno));
|
||||
(void) close(fd);
|
||||
(void) zutil_error(hdl, LPC_BADCACHE, dgettext(TEXT_DOMAIN,
|
||||
"failed to get size of cache file"));
|
||||
|
||||
Reference in New Issue
Block a user