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

[xen staging] tools: fix setting of errno in xenhypfs_read_raw()



commit 058023b343d4e366864831db46e9b438e9e3a178
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Tue Jun 9 16:48:50 2020 +0200
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Tue Jun 9 15:36:44 2020 +0000

    tools: fix setting of errno in xenhypfs_read_raw()
    
    Setting of errno is wrong in xenhypfs_read_raw(), fix it.
    
    Reported-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Fixes: 86234eafb9529 ("libs: add libxenhypfs")
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Paul Durrant <paul@xxxxxxx>
    Release-acked-by: Paul Durrant <paul@xxxxxxx>
    Acked-by: Wei Liu <wl@xxxxxxx>
---
 tools/libs/hypfs/core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/libs/hypfs/core.c b/tools/libs/hypfs/core.c
index fc23b02586..f94c5ea1e2 100644
--- a/tools/libs/hypfs/core.c
+++ b/tools/libs/hypfs/core.c
@@ -241,10 +241,8 @@ void *xenhypfs_read_raw(xenhypfs_handle *fshdl, const char 
*path,
         if (!ret)
             break;
 
-        if (ret != ENOBUFS) {
-            errno = -ret;
+        if (errno != ENOBUFS)
             goto out;
-        }
     }
 
     content = malloc(entry->content_len);
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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