mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
libzfs_sendrecv: Initialize in case of failure
In zfs_send_progress, initialize \*bytes_written and \*blocks_visited in case we have to return early due to ioctl failure. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes #12967
This commit is contained in:
parent
25074b472a
commit
24f1aa023a
@ -883,6 +883,10 @@ zfs_send_progress(zfs_handle_t *zhp, int fd, uint64_t *bytes_written,
|
||||
{
|
||||
zfs_cmd_t zc = {"\0"};
|
||||
|
||||
if (bytes_written != NULL)
|
||||
*bytes_written = 0;
|
||||
if (blocks_visited != NULL)
|
||||
*blocks_visited = 0;
|
||||
(void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
|
||||
zc.zc_cookie = fd;
|
||||
if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SEND_PROGRESS, &zc) != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user