util: Declare that virFileExists shall honor errno

Explicitly state that some parts of the code may require virFileExists
to set or preserve a correct errno so that future modifications don't
break.
This commit is contained in:
Peter Krempa 2013-09-13 14:35:34 +02:00
parent 6c038ee330
commit d66e7ce616
1 changed files with 6 additions and 0 deletions

View File

@ -1477,6 +1477,12 @@ virFileIsDir(const char *path)
return (stat(path, &s) == 0) && S_ISDIR(s.st_mode);
}
/**
* virFileExists: Check for presence of file
* @path: Path of file to check
*
* Returns if the file exists. Preserves errno in case it does not exist.
*/
bool
virFileExists(const char *path)
{