search for: _error_handler

Displaying 3 results from an estimated 3 matches for "_error_handler".

Did you mean: error_handler
2015 Jun 11
2
Re: [PATCH 3/5] threads: Use thread-local storage for errors.
...06, 2015 at 02:20:39PM +0100, Richard W.M. Jones wrote: > We permit the following constructs in libguestfs code: > > if (guestfs_some_call (g) == -1) { > fprintf (stderr, "failed: error is %s\n", guestfs_last_error (g)); > } > > and: > > guestfs_push_error_handler (g, NULL, NULL); > guestfs_some_call (g); > guestfs_pop_error_handler (g); > > Neither of these would be safe if we allowed the handle to be used > from threads concurrently, since the error string or error handler > could be changed by another thread. > > Solve this i...
2015 Jun 11
0
Re: [PATCH 3/5] threads: Use thread-local storage for errors.
...nes wrote: > > We permit the following constructs in libguestfs code: > > > > if (guestfs_some_call (g) == -1) { > > fprintf (stderr, "failed: error is %s\n", guestfs_last_error (g)); > > } > > > > and: > > > > guestfs_push_error_handler (g, NULL, NULL); > > guestfs_some_call (g); > > guestfs_pop_error_handler (g); > > > > Neither of these would be safe if we allowed the handle to be used > > from threads concurrently, since the error string or error handler > > could be changed by another t...
2013 Jul 17
1
Re: Redirecting libguestfs error messages
...ENVIRONMENT > * never prints anything on stderr. If it fails, it sets the > * global errno. So something like this should be used: > */ > fprintf (logfp, "error: %s\n", strerror (errno)); > exit (EXIT_FAILURE); > } > > (2) Call guestfs_set_error_handler just after creating the handle: > > guestfs_set_error_handler (g, NULL, NULL); > > (3) Call guestfs_parse_environment to parse the environment. This > would have been done by guestfs_create, except you set the > NO_ENVIRONMENT flag. > > if (guestfs_parse_environment (g)...