diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-25 21:33:06 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-25 21:33:06 +0000 |
commit | aa26bb2dacdc32bac84e7c72c501b4691721679e (patch) | |
tree | af09769389f3799984d680ab126002fad7a8cdbe /vl.c | |
parent | 209afb9e0dc4f4ed21ed696047d4c72f8a942810 (diff) |
qemu_create_pidfile implementation for Win32, based on a patch by
Carlos O'Donell.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2540 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -4403,29 +4403,6 @@ void usb_info(void) } } -static int create_pidfile(const char *filename) -{ - int fd; - char buffer[128]; - int len; - - fd = open(filename, O_RDWR | O_CREAT, 0600); - if (fd == -1) - return -1; - - /* XXX: No locking for Win32 implemented */ -#ifndef _WIN32 - if (lockf(fd, F_TLOCK, 0) == -1) - return -1; -#endif - - len = snprintf(buffer, sizeof(buffer), "%ld\n", (long)getpid()); - if (write(fd, buffer, len) != len) - return -1; - - return 0; -} - /***********************************************************/ /* dumb display */ @@ -7405,7 +7382,7 @@ int main(int argc, char **argv) } #endif - if (pid_file && create_pidfile(pid_file) != 0) { + if (pid_file && qemu_create_pidfile(pid_file) != 0) { if (daemonize) { uint8_t status = 1; write(fds[1], &status, 1); |