diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-11-09 18:03:49 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-11-09 19:51:09 +0000 |
commit | 2d220f5da2cd25e0fda0c98b98ecb384c1fe5c47 (patch) | |
tree | a718347b5c6141743397b90fe6cf90116a7c8738 /fish/fish.c | |
parent | b460d9f32eb527bc7aad4894a5f85c4e69366104 (diff) | |
download | libguestfs-2d220f5da2cd25e0fda0c98b98ecb384c1fe5c47.tar.gz libguestfs-2d220f5da2cd25e0fda0c98b98ecb384c1fe5c47.tar.xz libguestfs-2d220f5da2cd25e0fda0c98b98ecb384c1fe5c47.zip |
tools: Modify existing tools to use guestfs_{push,pop}_error_handler.
This is a shorter and more convenient way to disable errors
temporarily across calls.
Diffstat (limited to 'fish/fish.c')
-rw-r--r-- | fish/fish.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fish/fish.c b/fish/fish.c index 332ef1ac..25e49c7e 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1932,15 +1932,12 @@ feature_available (guestfs_h *g, const char *feature) /* If there's an error we should ignore it, so to do that we have to * temporarily replace the error handler with a null one. */ - guestfs_error_handler_cb old_error_cb; - void *old_error_data; - old_error_cb = guestfs_get_error_handler (g, &old_error_data); - guestfs_set_error_handler (g, NULL, NULL); + guestfs_push_error_handler (g, NULL, NULL); const char *groups[] = { feature, NULL }; int r = guestfs_available (g, (char * const *) groups); - guestfs_set_error_handler (g, old_error_cb, old_error_data); + guestfs_pop_error_handler (g); return r == 0 ? 1 : 0; } |