diff mbox series

[3/4] tools/libs/guest: don't set errno to a negative value

Message ID 20220420073119.16974-4-jgross@suse.com (mailing list archive)
State New, archived
Headers show
Series tools/libs: don't set errno to negative values | expand

Commit Message

Jürgen Groß April 20, 2022, 7:31 a.m. UTC
Setting errno to a negative error value makes no sense.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/guest/xg_dom_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Cooper April 22, 2022, 2:49 p.m. UTC | #1
On 20/04/2022 08:31, Juergen Gross wrote:
> Setting errno to a negative error value makes no sense.

Fixes: cb99a64029c9d

> Signed-off-by: Juergen Gross <jgross@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

diff --git a/tools/libs/guest/xg_dom_core.c b/tools/libs/guest/xg_dom_core.c
index c17cf9f712..c4f4e7f3e2 100644
--- a/tools/libs/guest/xg_dom_core.c
+++ b/tools/libs/guest/xg_dom_core.c
@@ -855,7 +855,7 @@  int xc_dom_devicetree_file(struct xc_dom_image *dom, const char *filename)
         return -1;
     return 0;
 #else
-    errno = -EINVAL;
+    errno = EINVAL;
     return -1;
 #endif
 }