Skip to content

Commit

Permalink
Format an error message when the ZFS_IOC_POOL_TRIM fails
Browse files Browse the repository at this point in the history
The message should be written to "msg" before calling
zpool_standard_error().
  • Loading branch information
dweeezil committed Apr 10, 2017
1 parent 7015eca commit 8254e7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/libzfs/libzfs_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,8 @@ zpool_trim(zpool_handle_t *zhp, boolean_t start, uint64_t rate)
if (zfs_ioctl(hdl, ZFS_IOC_POOL_TRIM, &zc) == 0)
return (0);

(void) snprintf(msg, sizeof (msg),
dgettext(TEXT_DOMAIN, "cannot trim %s"), zc.zc_name);
return (zpool_standard_error(hdl, errno, msg));
}

Expand Down

0 comments on commit 8254e7d

Please sign in to comment.