[Libguestfs] [PATCH 6/9] daemon error handling: clear errors before all functions

Richard W.M. Jones rjones at redhat.com
Fri Nov 27 18:04:40 UTC 2009


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
-------------- next part --------------
>From e2b84e1f754fda37223dc9da152a9490cf6f9ea4 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones at redhat.com>
Date: Fri, 27 Nov 2009 13:48:06 +0000
Subject: [PATCH 6/9] daemon error handling: clear errors before all functions

This isn't strictly necessary, but doesn't do any harm and
may provide more reliable error messages in the case where
our error handling code is wrong.
---
 daemon/proto.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/daemon/proto.c b/daemon/proto.c
index 7c923c8..23748a4 100644
--- a/daemon/proto.c
+++ b/daemon/proto.c
@@ -143,6 +143,7 @@ main_loop (int _sock)
     /* Now start to process this message. */
     proc_nr = hdr.proc;
     serial = hdr.serial;
+    clear_error (); /* Make sure errno is clear before calling the function. */
     dispatch_incoming_message (&xdr);
     /* Note that dispatch_incoming_message will also send a reply. */
 
-- 
1.6.5.2



More information about the Libguestfs mailing list