diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs/libzfs_pool.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 2054385b8..db1f0d7cf 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -3790,11 +3790,12 @@ zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) * no new events are available. In either case the function returns 0 and * it is up to the caller to free 'nvp'. In the case of a fatal error the * function will return a non-zero value. When the function is called in - * blocking mode it will not return until a new event is available. + * blocking mode (the default, unless the ZEVENT_NONBLOCK flag is passed), + * it will not return until a new event is available. */ int zpool_events_next(libzfs_handle_t *hdl, nvlist_t **nvp, - int *dropped, int block, int zevent_fd) + int *dropped, unsigned flags, int zevent_fd) { zfs_cmd_t zc = {"\0"}; int error = 0; @@ -3803,7 +3804,7 @@ zpool_events_next(libzfs_handle_t *hdl, nvlist_t **nvp, *dropped = 0; zc.zc_cleanup_fd = zevent_fd; - if (!block) + if (flags & ZEVENT_NONBLOCK) zc.zc_guid = ZEVENT_NONBLOCK; if (zcmd_alloc_dst_nvlist(hdl, &zc, ZEVENT_SIZE) != 0) @@ -3818,7 +3819,7 @@ retry: goto out; case ENOENT: /* Blocking error case should not occur */ - if (block) + if (!(flags & ZEVENT_NONBLOCK)) error = zpool_standard_error_fmt(hdl, errno, dgettext(TEXT_DOMAIN, "cannot get event")); |