mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
libzfs: format safety
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12116
This commit is contained in:
@@ -732,7 +732,7 @@ zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap,
|
||||
}
|
||||
|
||||
if (pipe2(pipefd, O_CLOEXEC)) {
|
||||
zfs_error_aux(zhp->zfs_hdl, strerror(errno));
|
||||
zfs_error_aux(zhp->zfs_hdl, "%s", strerror(errno));
|
||||
teardown_differ_info(&di);
|
||||
return (zfs_error(zhp->zfs_hdl, EZFS_PIPEFAILED, errbuf));
|
||||
}
|
||||
@@ -745,7 +745,7 @@ zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap,
|
||||
di.datafd = pipefd[0];
|
||||
|
||||
if (pthread_create(&tid, NULL, differ, &di)) {
|
||||
zfs_error_aux(zhp->zfs_hdl, strerror(errno));
|
||||
zfs_error_aux(zhp->zfs_hdl, "%s", strerror(errno));
|
||||
(void) close(pipefd[0]);
|
||||
(void) close(pipefd[1]);
|
||||
teardown_differ_info(&di);
|
||||
@@ -771,14 +771,14 @@ zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap,
|
||||
zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
|
||||
"\n Not an earlier snapshot from the same fs"));
|
||||
} else if (errno != EPIPE || di.zerr == 0) {
|
||||
zfs_error_aux(zhp->zfs_hdl, strerror(errno));
|
||||
zfs_error_aux(zhp->zfs_hdl, "%s", strerror(errno));
|
||||
}
|
||||
(void) close(pipefd[1]);
|
||||
(void) pthread_cancel(tid);
|
||||
(void) pthread_join(tid, NULL);
|
||||
teardown_differ_info(&di);
|
||||
if (di.zerr != 0 && di.zerr != EPIPE) {
|
||||
zfs_error_aux(zhp->zfs_hdl, strerror(di.zerr));
|
||||
zfs_error_aux(zhp->zfs_hdl, "%s", strerror(di.zerr));
|
||||
return (zfs_error(zhp->zfs_hdl, EZFS_DIFF, di.errbuf));
|
||||
} else {
|
||||
return (zfs_error(zhp->zfs_hdl, EZFS_DIFFDATA, errbuf));
|
||||
@@ -789,7 +789,7 @@ zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap,
|
||||
(void) pthread_join(tid, NULL);
|
||||
|
||||
if (di.zerr != 0) {
|
||||
zfs_error_aux(zhp->zfs_hdl, strerror(di.zerr));
|
||||
zfs_error_aux(zhp->zfs_hdl, "%s", strerror(di.zerr));
|
||||
return (zfs_error(zhp->zfs_hdl, EZFS_DIFF, di.errbuf));
|
||||
}
|
||||
teardown_differ_info(&di);
|
||||
|
||||
Reference in New Issue
Block a user