[xen staging] tests/xs: use ENOENT instead of ENODATA

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen staging] tests/xs: use ENOENT instead of ENODATA

patchbot
commit 92e8f80ec042efa88ae7dce8832f8f6e5e84bf81
Author:     Roger Pau Monne <[hidden email]>
AuthorDate: Mon Jul 2 10:28:25 2018 +0200
Commit:     Wei Liu <[hidden email]>
CommitDate: Tue Jul 10 08:42:07 2018 +0100

    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é <[hidden email]>
    Acked-by: Wei Liu <[hidden email]>
---
 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 ec0e47a345..17d4a66b85 100644
--- a/tools/tests/xenstore/xs-test.c
+++ b/tools/tests/xenstore/xs-test.c
@@ -156,7 +156,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;
@@ -238,10 +238,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;
 }
@@ -321,14 +321,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;
@@ -376,7 +376,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;
@@ -385,12 +385,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:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog