summaryrefslogtreecommitdiffstats
path: root/fish/destpaths.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-11-09 18:03:49 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-11-09 19:51:09 +0000
commit2d220f5da2cd25e0fda0c98b98ecb384c1fe5c47 (patch)
treea718347b5c6141743397b90fe6cf90116a7c8738 /fish/destpaths.c
parentb460d9f32eb527bc7aad4894a5f85c4e69366104 (diff)
downloadlibguestfs-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/destpaths.c')
-rw-r--r--fish/destpaths.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/fish/destpaths.c b/fish/destpaths.c
index f3cf0f2e..bc355ccc 100644
--- a/fish/destpaths.c
+++ b/fish/destpaths.c
@@ -89,19 +89,6 @@ complete_dest_paths_generator (const char *text, int state)
static size_t len, index;
static struct word *words = NULL;
static size_t nr_words = 0;
- guestfs_error_handler_cb old_error_cb;
- void *old_error_cb_data;
-
- /* Temporarily replace the error handler so that messages don't
- * get printed to stderr while we are issuing commands.
- */
-#define SAVE_ERROR_CB \
- old_error_cb = guestfs_get_error_handler (g, &old_error_cb_data); \
- guestfs_set_error_handler (g, NULL, NULL);
-
- /* Restore error handler. */
-#define RESTORE_ERROR_CB \
- guestfs_set_error_handler (g, old_error_cb, old_error_cb_data);
if (!state) {
char **strs;
@@ -114,7 +101,7 @@ complete_dest_paths_generator (const char *text, int state)
words = NULL;
nr_words = 0;
- SAVE_ERROR_CB
+ guestfs_push_error_handler (g, NULL, NULL);
/* Silently do nothing if an allocation fails */
#define APPEND_STRS_AND_FREE \
@@ -220,7 +207,7 @@ complete_dest_paths_generator (const char *text, int state)
* names. At the moment we don't do that.
*/
- RESTORE_ERROR_CB
+ guestfs_pop_error_handler (g);
}
/* This inhibits ordinary (local filename) completion. */