Commit bd54b863947933a985f53e1ca6002752abd8b645
1 parent
c7ba218d
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
Showing
1 changed file
with
1 additions
and
6 deletions
vl.c
@@ -8626,11 +8626,6 @@ int main(int argc, char **argv) | @@ -8626,11 +8626,6 @@ int main(int argc, char **argv) | ||
8626 | } | 8626 | } |
8627 | 8627 | ||
8628 | #ifndef _WIN32 | 8628 | #ifndef _WIN32 |
8629 | - if (daemonize && !nographic && vnc_display == NULL) { | ||
8630 | - fprintf(stderr, "Can only daemonize if using -nographic or -vnc\n"); | ||
8631 | - daemonize = 0; | ||
8632 | - } | ||
8633 | - | ||
8634 | if (daemonize) { | 8629 | if (daemonize) { |
8635 | pid_t pid; | 8630 | pid_t pid; |
8636 | 8631 | ||
@@ -8668,7 +8663,6 @@ int main(int argc, char **argv) | @@ -8668,7 +8663,6 @@ int main(int argc, char **argv) | ||
8668 | exit(1); | 8663 | exit(1); |
8669 | 8664 | ||
8670 | umask(027); | 8665 | umask(027); |
8671 | - chdir("/"); | ||
8672 | 8666 | ||
8673 | signal(SIGTSTP, SIG_IGN); | 8667 | signal(SIGTSTP, SIG_IGN); |
8674 | signal(SIGTTOU, SIG_IGN); | 8668 | signal(SIGTTOU, SIG_IGN); |
@@ -8974,6 +8968,7 @@ int main(int argc, char **argv) | @@ -8974,6 +8968,7 @@ int main(int argc, char **argv) | ||
8974 | if (len != 1) | 8968 | if (len != 1) |
8975 | exit(1); | 8969 | exit(1); |
8976 | 8970 | ||
8971 | + chdir("/"); | ||
8977 | TFR(fd = open("/dev/null", O_RDWR)); | 8972 | TFR(fd = open("/dev/null", O_RDWR)); |
8978 | if (fd == -1) | 8973 | if (fd == -1) |
8979 | exit(1); | 8974 | exit(1); |