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 /examples | |
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 'examples')
-rw-r--r-- | examples/mount_local.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/mount_local.c b/examples/mount_local.c index 2fe1a8f3..fb09bb3b 100644 --- a/examples/mount_local.c +++ b/examples/mount_local.c @@ -45,8 +45,6 @@ main (int argc, char *argv[]) char tempdir[] = "/tmp/mlXXXXXX"; pid_t pid; char *shell, *p; - guestfs_error_handler_cb old_error_cb; - void *old_error_data; if (argc != 2) { usage (); @@ -175,14 +173,13 @@ main (int argc, char *argv[]) /* We're going to hide libguestfs errors here, but in a real program * you would probably want to log them somewhere. */ - 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); /* Now run the FUSE thread. */ if (guestfs_mount_local_run (g) == -1) exit (EXIT_FAILURE); - guestfs_set_error_handler (g, old_error_cb, old_error_data); + guestfs_pop_error_handler (g); waitpid (pid, NULL, 0); |