21/22 Disable exec in util.c

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

 



It's not likely that the external programs will actually exist on MinGW anyway, so execing them isn't very useful.

This also removes the virFileLinkPointsTo function, which I think is only used by libvirtd anyway.

Rich.

--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
Index: src/util.c
===================================================================
RCS file: /data/cvs/libvirt/src/util.c,v
retrieving revision 1.9
diff -u -r1.9 util.c
--- src/util.c	5 Dec 2007 13:56:22 -0000	1.9
+++ src/util.c	7 Dec 2007 11:05:32 -0000
@@ -65,6 +68,8 @@
                     NULL, NULL, NULL, -1, -1, "%s", errorMessage);
 }
 
+#ifndef __MINGW32__
+
 static int virSetCloseExec(int fd) {
     int flags;
     if ((flags = fcntl(fd, F_GETFD)) < 0)
@@ -198,6 +203,34 @@
     return(_virExec(conn, argv, retpid, infd, outfd, errfd, 1));
 }
 
+#else /* __MINGW32__ */
+
+int
+virExec(virConnectPtr conn,
+        char **argv ATTRIBUTE_UNUSED,
+        int *retpid ATTRIBUTE_UNUSED,
+        int infd ATTRIBUTE_UNUSED,
+        int *outfd ATTRIBUTE_UNUSED,
+        int *errfd ATTRIBUTE_UNUSED)
+{
+    ReportError (conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
+    return -1;
+}
+
+int
+virExecNonBlock(virConnectPtr conn,
+                char **argv ATTRIBUTE_UNUSED,
+                int *retpid ATTRIBUTE_UNUSED,
+                int infd ATTRIBUTE_UNUSED,
+                int *outfd ATTRIBUTE_UNUSED,
+                int *errfd ATTRIBUTE_UNUSED)
+{
+    ReportError (conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
+    return -1;
+}
+
+#endif /* __MINGW32__ */
+
 /* Like read(), but restarts after EINTR */
 int saferead(int fd, void *buf, size_t count)
 {
@@ -313,6 +346,7 @@
     return strcmp(str + len - suffixlen, suffix) == 0;
 }
 
+#ifndef __MINGW32__
 
 int virFileLinkPointsTo(const char *checkLink,
                         const char *checkDest)
@@ -397,6 +431,22 @@
     return 1;
 }
 
+#else /* !__MINGW32__ */
+
+/* Gnulib has an implementation of readlink which could be used
+ * to implement this, but it requires LGPLv3.
+ */
+
+int
+virFileLinkPointsTo (const char *checkLink ATTRIBUTE_UNUSED,
+                     const char *checkDest ATTRIBUTE_UNUSED)
+{
+    virLog ("%s: not implemented", __FUNCTION__);
+    return 0;
+}
+
+#endif /*! __MINGW32__ */
+
 int virFileMakePath(const char *path)
 {
     struct stat st;

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

--
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]