]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
tools/libs/store: make libxenstore independent of utils.h
authorJuergen Gross <jgross@suse.com>
Tue, 30 May 2023 08:54:13 +0000 (10:54 +0200)
committerJulien Grall <julien@xen.org>
Mon, 12 Jun 2023 21:37:22 +0000 (22:37 +0100)
There is no real need for including tools/xenstore/utils.h from
libxenstore, as only streq() and ARRAY_SIZE() are obtained via that
header.

streq() is just !strcmp(), and ARRAY_SIZE() is brought in via
xen-tools/common-macros.h.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
tools/libs/store/xs.c

index 3813b69ae2e274137b293c7f978eda71cc45c00f..76ffb1be45af3f0fbfdd87513ef939b4126b07b2 100644 (file)
@@ -33,9 +33,9 @@
 #include <signal.h>
 #include <stdint.h>
 #include <errno.h>
+#include <xen-tools/common-macros.h>
 #include "xenstore.h"
 #include "xs_lib.h"
-#include "utils.h"
 
 #include <xentoolcore_internal.h>
 #include <xen_list.h>
@@ -437,7 +437,7 @@ static int get_error(const char *errorstring)
 {
        unsigned int i;
 
-       for (i = 0; !streq(errorstring, xsd_errors[i].errstring); i++)
+       for (i = 0; strcmp(errorstring, xsd_errors[i].errstring); i++)
                if (i == ARRAY_SIZE(xsd_errors) - 1)
                        return EINVAL;
        return xsd_errors[i].errnum;