mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
6c038ee330
commit
d66e7ce616
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue