]> git.proxmox.com Git - mirror_zfs.git/commitdiff
libzfs: Prevent overridding of error code
authorixhamza <106930537+ixhamza@users.noreply.github.com>
Wed, 15 Jun 2022 21:26:12 +0000 (02:26 +0500)
committerGitHub <noreply@github.com>
Wed, 15 Jun 2022 21:26:12 +0000 (14:26 -0700)
zfs_send_cb_impl fails to report error for some flags.

Use second error variable for send_conclusion_record.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #13558

lib/libzfs/libzfs_sendrecv.c

index f7b2a0e870f3264e41fa2eac1e8d5df4f44b1de8..a27446f54da7c546d476b0f96999a93bdd53c131 100644 (file)
@@ -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);