Revision b9e82a59 vl.c
b/vl.c | ||
---|---|---|
245 | 245 |
int no_shutdown = 0; |
246 | 246 |
int cursor_hide = 1; |
247 | 247 |
int graphic_rotate = 0; |
248 |
#ifndef _WIN32 |
|
248 | 249 |
int daemonize = 0; |
250 |
#endif |
|
249 | 251 |
const char *option_rom[MAX_OPTION_ROMS]; |
250 | 252 |
int nb_option_roms; |
251 | 253 |
int semihosting_enabled = 0; |
... | ... | |
1297 | 1299 |
} |
1298 | 1300 |
|
1299 | 1301 |
#ifdef _WIN32 |
1300 |
void CALLBACK host_alarm_handler(UINT uTimerID, UINT uMsg, |
|
1301 |
DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) |
|
1302 |
static void CALLBACK host_alarm_handler(UINT uTimerID, UINT uMsg, |
|
1303 |
DWORD_PTR dwUser, DWORD_PTR dw1, |
|
1304 |
DWORD_PTR dw2) |
|
1302 | 1305 |
#else |
1303 | 1306 |
static void host_alarm_handler(int host_signum) |
1304 | 1307 |
#endif |
... | ... | |
4262 | 4265 |
const char *cpu_model; |
4263 | 4266 |
const char *usb_devices[MAX_USB_CMDLINE]; |
4264 | 4267 |
int usb_devices_index; |
4268 |
#ifndef _WIN32 |
|
4265 | 4269 |
int fds[2]; |
4270 |
#endif |
|
4266 | 4271 |
int tb_size; |
4267 | 4272 |
const char *pid_file = NULL; |
4268 | 4273 |
const char *incoming = NULL; |
4274 |
#ifndef _WIN32 |
|
4269 | 4275 |
int fd = 0; |
4270 | 4276 |
struct passwd *pwd = NULL; |
4271 | 4277 |
const char *chroot_dir = NULL; |
4272 | 4278 |
const char *run_as = NULL; |
4279 |
#endif |
|
4273 | 4280 |
|
4274 | 4281 |
qemu_cache_utils_init(envp); |
4275 | 4282 |
|
... | ... | |
5015 | 5022 |
signal(SIGTTOU, SIG_IGN); |
5016 | 5023 |
signal(SIGTTIN, SIG_IGN); |
5017 | 5024 |
} |
5018 |
#endif |
|
5019 | 5025 |
|
5020 | 5026 |
if (pid_file && qemu_create_pidfile(pid_file) != 0) { |
5021 | 5027 |
if (daemonize) { |
... | ... | |
5025 | 5031 |
fprintf(stderr, "Could not acquire pid file\n"); |
5026 | 5032 |
exit(1); |
5027 | 5033 |
} |
5034 |
#endif |
|
5028 | 5035 |
|
5029 | 5036 |
#ifdef USE_KQEMU |
5030 | 5037 |
if (smp_cpus > 1) |
... | ... | |
5385 | 5392 |
if (autostart) |
5386 | 5393 |
vm_start(); |
5387 | 5394 |
|
5395 |
#ifndef _WIN32 |
|
5388 | 5396 |
if (daemonize) { |
5389 | 5397 |
uint8_t status = 0; |
5390 | 5398 |
ssize_t len; |
... | ... | |
5403 | 5411 |
exit(1); |
5404 | 5412 |
} |
5405 | 5413 |
|
5406 |
#ifndef _WIN32 |
|
5407 | 5414 |
if (run_as) { |
5408 | 5415 |
pwd = getpwnam(run_as); |
5409 | 5416 |
if (!pwd) { |
... | ... | |
5434 | 5441 |
exit(1); |
5435 | 5442 |
} |
5436 | 5443 |
} |
5437 |
#endif |
|
5438 | 5444 |
|
5439 | 5445 |
if (daemonize) { |
5440 | 5446 |
dup2(fd, 0); |
... | ... | |
5443 | 5449 |
|
5444 | 5450 |
close(fd); |
5445 | 5451 |
} |
5452 |
#endif |
|
5446 | 5453 |
|
5447 | 5454 |
main_loop(); |
5448 | 5455 |
quit_timers(); |
Also available in: Unified diff