[PATCH 05/20] tools/xenstore: preserve errno across corrupt()

Juergen Gross posted 20 patches 3 years, 3 months ago
There is a newer version of this series
[PATCH 05/20] tools/xenstore: preserve errno across corrupt()
Posted by Juergen Gross 3 years, 3 months ago
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>
---
 tools/xenstore/xenstored_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index d48208ecfe..8c2cca62b7 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -2549,6 +2549,8 @@ void corrupt(struct connection *conn, const char *fmt, ...)
 	talloc_free(str);
 
 	check_store();
+
+	errno = saved_errno;
 }
 
 #ifndef NO_SOCKETS
-- 
2.35.3
Re: [PATCH 05/20] tools/xenstore: preserve errno across corrupt()
Posted by Julien Grall 3 years, 3 months ago
Hi Juergen,

On 01/11/2022 15:28, Juergen Gross wrote:
> 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>

Cheers,

-- 
Julien Grall