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.
This commit is contained in:
Michal Privoznik 2012-02-22 09:55:27 +01:00
parent 419e5fb3e6
commit b90d4722a5
1 changed files with 6 additions and 2 deletions

View File

@ -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.