[PATCH] win32: Pretend that close-on-exec works

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

 



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.
---
 src/util/util.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/util/util.c b/src/util/util.c
index 43fdaf1..356a03a 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -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 */
-- 
1.7.4.1

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