From 099fe236d5e37e8477d17fae09f398bb49eebc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20Riihim=C3=A4ki?= Date: Thu, 3 Dec 2009 15:56:03 +0200 Subject: fix pidfile option to work in WIN32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Juha Riihimäki Signed-off-by: Riku Voipio Signed-off-by: Aurelien Jarno --- vl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 8be3648f4..e60690346 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; -- cgit v1.2.3