]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
tools/xenstore: preserve errno across corrupt()
authorJuergen Gross <jgross@suse.com>
Wed, 14 Dec 2022 11:02:04 +0000 (12:02 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 14 Dec 2022 11:02:04 +0000 (12:02 +0100)
Let corrupt() preserve errno in order to be able to simplify error
handling in future.

This is rather easy as the errno value when entering corrupt() is
saved already.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
tools/xenstore/xenstored_core.c

index 4cd54c8b5a51e568de86cedb4c40e58510a572f2..f68f82cb1927efdf2e4b853596103f2c836aae52 100644 (file)
@@ -2551,6 +2551,8 @@ void corrupt(struct connection *conn, const char *fmt, ...)
        talloc_free(str);
 
        check_store();
+
+       errno = saved_errno;
 }
 
 #ifndef NO_SOCKETS