aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorJuha Riihimäki <juha.riihimaki@nokia.com>2009-12-03 15:56:03 +0200
committerAurelien Jarno <aurelien@aurel32.net>2009-12-18 23:23:56 +0100
commit099fe236d5e37e8477d17fae09f398bb49eebc13 (patch)
tree687d79961d8f49d98b642bf3b4b86dbfdb5f1e17 /vl.c
parent1e8b27ca853d26e8854dc1a3e7ce88605e1673b9 (diff)
fix pidfile option to work in WIN32
Explicit read/write locking pidfile under WIN32 is bit extreme nobody get the chance to read the pidfile. Convert to a write-only lock. Also, creating pidfile was disabled along with daemonize under WIN32. Enable it, but do not enable daemon support which doesn't exist under WIN32 atm. From: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index 8be3648f4f..e606903465 100644
--- a/vl.c
+++ b/vl.c
@@ -5761,16 +5761,18 @@ int main(int argc, char **argv, char **envp)
signal(SIGTTOU, SIG_IGN);
signal(SIGTTIN, SIG_IGN);
}
+#endif
if (pid_file && qemu_create_pidfile(pid_file) != 0) {
+#ifndef _WIN32
if (daemonize) {
uint8_t status = 1;
write(fds[1], &status, 1);
} else
+#endif
fprintf(stderr, "Could not acquire pid file: %s\n", strerror(errno));
exit(1);
}
-#endif
if (kvm_enabled()) {
int ret;