[libvirt] [PATCH] util: Add win32 version of virFileUnlink

Martin Kletzander mkletzan at redhat.com
Mon Sep 7 08:25:24 UTC 2015


Commit 35847860f65f Added the virFileUnlink function, but failed to add
a version for mingw build, causing the following error:

  Cannot export virFileUnlink: symbol not defined

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 src/util/virfile.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 408d2d912f13..75819d9c8bd7 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -2637,6 +2637,20 @@ virDirCreate(const char *path ATTRIBUTE_UNUSED,

     return -ENOSYS;
 }
+
+int
+virFileUnlink(const char *path,
+              uid_t uid ATTRIBUTE_UNUSED,
+              gid_t gid ATTRIBUTE_UNUSED)
+{
+    if (unlink(path) < 0) {
+        virReportSystemError(errno, _("Unable to unlink path '%s'"),
+                             path);
+        return -1;
+    }
+
+    return 0;
+}
 #endif /* WIN32 */

 /**
-- 
2.5.1




More information about the libvir-list mailing list