mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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);
|
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
|
bool
|
||||||
virFileExists(const char *path)
|
virFileExists(const char *path)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user