]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Add win32 version of virFileUnlink
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 7 Sep 2015 08:24:47 +0000 (10:24 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 8 Sep 2015 09:54:53 +0000 (11:54 +0200)
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@redhat.com>
src/util/virfile.c

index 408d2d912f13938bb97e20d89509a08525e006e0..75819d9c8bd74a432397307834f7c0469fd058f5 100644 (file)
@@ -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 */
 
 /**