[PATCH] util: Fix virFileAccessibleAs return path from parent

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

 



Despite documentation, if we do fork() parent always returns -1
even if file is accessible. Which is wrong obviously.
---
 src/util/util.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/util/util.c b/src/util/util.c
index 3406b7b..04a0e79 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -724,8 +724,12 @@ virFileAccessibleAs(const char *path, int mode,
                 return -1;
         }
 
-        errno = status;
-        return -1;
+        if (!status) {
+            errno = status;
+            return -1;
+        }
+
+        return 0;
     }
 
     /* child.
-- 
1.7.3.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]