summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-23 00:58:33 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-23 00:58:33 +0000
commitbd54b863947933a985f53e1ca6002752abd8b645 (patch)
treeac7aee0462d895f7c2b17e435bb9acee4bf6ca20 /vl.c
parentc7ba218da1639a054b5ca1c259530305562fa571 (diff)
downloadqemu-bd54b863947933a985f53e1ca6002752abd8b645.tar.gz
Fix -daemonize option
When using -daemonize, we want to avoid chdir() until after we've opened the block devices. It's also perfectly fine to use -dameonize along with SDL. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4924 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/vl.c b/vl.c
index f057a5e6b5..d94ebb1721 100644
--- a/vl.c
+++ b/vl.c
@@ -8626,11 +8626,6 @@ int main(int argc, char **argv)
}
#ifndef _WIN32
- if (daemonize && !nographic && vnc_display == NULL) {
- fprintf(stderr, "Can only daemonize if using -nographic or -vnc\n");
- daemonize = 0;
- }
-
if (daemonize) {
pid_t pid;
@@ -8668,7 +8663,6 @@ int main(int argc, char **argv)
exit(1);
umask(027);
- chdir("/");
signal(SIGTSTP, SIG_IGN);
signal(SIGTTOU, SIG_IGN);
@@ -8974,6 +8968,7 @@ int main(int argc, char **argv)
if (len != 1)
exit(1);
+ chdir("/");
TFR(fd = open("/dev/null", O_RDWR));
if (fd == -1)
exit(1);