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

[libvirt] [PATCH] util: Fix virFileAccessibleAs return path from parent



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


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