[PATCH 1/3] util: Declare that virFileExists shall honor errno

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index feac3c9..67adc55 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -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 wether file exists. Preserves errno in case it does not exist.
+ */
 bool
 virFileExists(const char *path)
 {
-- 
1.8.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]