]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
win32: Pretend that close-on-exec works
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 9 Oct 2012 20:49:46 +0000 (22:49 +0200)
committerEric Blake <eblake@redhat.com>
Tue, 17 Sep 2013 17:48:09 +0000 (11:48 -0600)
Currently virNetSocketNew fails because virSetCloseExec fails as there
is no proper implementation for it on Windows at the moment. Workaround
this by pretending that setting close-on-exec on the fd works. This can
be done because libvirt currently lacks the ability to create child
processes on Windows anyway. So there is no point in failing to set a
flag that isn't useful at the moment anyway.

(cherry picked from commit fcfa4bfb1660cdb083aa61e366ddc8e91a53e3ed)

src/util/util.c

index f0ccaf4dcf7b3fdcd7315dbed93ed35c38ee309a..ddc0d45aadeac3bb312ef49ad94191da950581bf 100644 (file)
@@ -275,7 +275,11 @@ int virSetInherit(int fd, bool inherit) {
 
 int virSetInherit(int fd ATTRIBUTE_UNUSED, bool inherit ATTRIBUTE_UNUSED)
 {
-    return -1;
+    /* FIXME: Currently creating child processes is not supported on
+     * Win32, so there is no point in failing calls that are only relevant
+     * when creating child processes. So just pretend that we changed the
+     * inheritance property of the given fd as requested. */
+    return 0;
 }
 
 #endif /* WIN32 */