]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage_file_backend_fs: Compile out 'chown' backend on mingw
authorPeter Krempa <pkrempa@redhat.com>
Mon, 20 Jan 2025 14:35:53 +0000 (15:35 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 20 Jan 2025 15:47:24 +0000 (16:47 +0100)
Otherwise build on mingw complains:

  src/storage_file/storage_file_backend_fs.c:142:12: error: implicit declaration of function 'chown

Fixes: f8558a87ac8525b16f4cbba4f24e0885fde2b79e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/storage_file/storage_file_backend_fs.c

index 1de822200dfab57aba00ede764deadbc4c5feb79..92de403e3a1c4415109ebc8e48d28f1565d9be1e 100644 (file)
@@ -23,6 +23,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <unistd.h>
 
 #include "virerror.h"
 #include "storage_file_backend.h"
@@ -134,6 +135,7 @@ virStorageFileBackendFileAccess(virStorageSource *src,
 }
 
 
+#ifndef WIN32
 static int
 virStorageFileBackendFileChown(const virStorageSource *src,
                                uid_t uid,
@@ -141,6 +143,7 @@ virStorageFileBackendFileChown(const virStorageSource *src,
 {
     return chown(src->path, uid, gid);
 }
+#endif
 
 
 virStorageFileBackend virStorageFileBackendFile = {
@@ -154,7 +157,9 @@ virStorageFileBackend virStorageFileBackendFile = {
     .storageFileStat = virStorageFileBackendFileStat,
     .storageFileRead = virStorageFileBackendFileRead,
     .storageFileAccess = virStorageFileBackendFileAccess,
+#ifndef WIN32
     .storageFileChown = virStorageFileBackendFileChown,
+#endif
 };
 
 
@@ -167,7 +172,9 @@ virStorageFileBackend virStorageFileBackendBlock = {
     .storageFileStat = virStorageFileBackendFileStat,
     .storageFileRead = virStorageFileBackendFileRead,
     .storageFileAccess = virStorageFileBackendFileAccess,
+#ifndef WIN32
     .storageFileChown = virStorageFileBackendFileChown,
+#endif
 };
 
 
@@ -178,7 +185,9 @@ virStorageFileBackend virStorageFileBackendDir = {
     .backendDeinit = virStorageFileBackendFileDeinit,
 
     .storageFileAccess = virStorageFileBackendFileAccess,
+#ifndef WIN32
     .storageFileChown = virStorageFileBackendFileChown,
+#endif
 };