[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 3/4] tests/xs: use ENOENT instead of ENODATA



ENODATA is not part of the standard set of errno values, so use
ENOENT instead. This fixes the build on FreeBSD.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/tests/xenstore/xs-test.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/tests/xenstore/xs-test.c b/tools/tests/xenstore/xs-test.c
index eb5fe55722..38e71d4f92 100644
--- a/tools/tests/xenstore/xs-test.c
+++ b/tools/tests/xenstore/xs-test.c
@@ -155,7 +155,7 @@ static int verify_node(char *node, char *data, unsigned int 
size)
     if ( !buf )
         return errno;
 
-    ret = (len == size && !memcmp(buf, data, len)) ? 0 : ENODATA;
+    ret = (len == size && !memcmp(buf, data, len)) ? 0 : ENOENT;
     free(buf);
 
     return ret;
@@ -237,10 +237,10 @@ static int test_dir_deinit(uintptr_t par)
             if ( dir[i][0] == 'a' + j && dir[i][1] == 0 )
                 break;
         if ( i == num )
-            rc = ENODATA;
+            rc = ENOENT;
     }
     if ( num != WRITE_BUFFERS_N )
-            rc = ENODATA;
+            rc = ENOENT;
     free(dir);
     return rc;
 }
@@ -320,14 +320,14 @@ static int test_ta2(uintptr_t par)
         buf = xs_read(xsh, t, paths[0], &len);
         if ( !buf )
             goto out;
-        errno = (len == 1 && buf[0] == 'b') ? 0 : ENODATA;
+        errno = (len == 1 && buf[0] == 'b') ? 0 : ENOENT;
         free(buf);
         if ( errno )
             goto out;
         buf = xs_read(xsh, XBT_NULL, paths[0], &len);
         if ( !buf )
             goto out;
-        errno = (len == 1 && buf[0] == 'a') ? 0 : ENODATA;
+        errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
         free(buf);
         if ( errno )
             goto out;
@@ -375,7 +375,7 @@ static int test_ta3(uintptr_t par)
     buf = xs_read(xsh, t, paths[0], &len);
     if ( !buf )
         goto out;
-    errno = (len == 1 && buf[0] == 'a') ? 0 : ENODATA;
+    errno = (len == 1 && buf[0] == 'a') ? 0 : ENOENT;
     free(buf);
     if ( errno )
         goto out;
@@ -384,12 +384,12 @@ static int test_ta3(uintptr_t par)
     buf = xs_read(xsh, t, paths[0], &len);
     if ( !buf )
         goto out;
-    errno = (len == 1 && buf[0] == 'c') ? 0 : ENODATA;
+    errno = (len == 1 && buf[0] == 'c') ? 0 : ENOENT;
     free(buf);
     if ( errno )
         goto out;
     if ( xs_transaction_end(xsh, t, false) || errno != EAGAIN )
-        return ENODATA;
+        return ENOENT;
     return 0;
 
  out:
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.