From b90d4722a5dcf30986f520a4674976f3a55b06ad Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 22 Feb 2012 09:55:27 +0100 Subject: [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 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/util.c b/src/util/util.c index 3406b7b506..7c58c7b05d 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.