Skip to content

Commit

Permalink
libzfs: Prevent overridding of error code
Browse files Browse the repository at this point in the history
zfs_send_cb_impl fails to report error for some flags.

Use second error variable for send_conclusion_record.

Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
  • Loading branch information
ixhamza committed Jun 14, 2022
1 parent 4ff7a8f commit 0ce5fca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/libzfs/libzfs_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2366,9 +2366,9 @@ zfs_send_cb_impl(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
* there was some error, because it might not be totally
* failed.
*/
err = send_conclusion_record(outfd, NULL);
if (err != 0)
return (zfs_standard_error(zhp->zfs_hdl, err, errbuf));
int err2 = send_conclusion_record(outfd, NULL);
if (err2 != 0)
return (zfs_standard_error(zhp->zfs_hdl, err2, errbuf));
}

return (err || sdd.err);
Expand Down

0 comments on commit 0ce5fca

Please sign in to comment.