]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Declare that virFileExists shall honor errno
authorPeter Krempa <pkrempa@redhat.com>
Fri, 13 Sep 2013 12:35:34 +0000 (14:35 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 Sep 2013 06:57:26 +0000 (08:57 +0200)
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.

src/util/virfile.c

index feac3c98e1f11981d82ccb52e0e410dd3f0bf8a7..a7635f45b6589470f033072ba42cdc4088582e7a 100644 (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)
 {