Commit bd54b863947933a985f53e1ca6002752abd8b645

Authored by aliguori
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
... ... @@ -8626,11 +8626,6 @@ int main(int argc, char **argv)
8626 8626 }
8627 8627  
8628 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 8629 if (daemonize) {
8635 8630 pid_t pid;
8636 8631  
... ... @@ -8668,7 +8663,6 @@ int main(int argc, char **argv)
8668 8663 exit(1);
8669 8664  
8670 8665 umask(027);
8671   - chdir("/");
8672 8666  
8673 8667 signal(SIGTSTP, SIG_IGN);
8674 8668 signal(SIGTTOU, SIG_IGN);
... ... @@ -8974,6 +8968,7 @@ int main(int argc, char **argv)
8974 8968 if (len != 1)
8975 8969 exit(1);
8976 8970  
  8971 + chdir("/");
8977 8972 TFR(fd = open("/dev/null", O_RDWR));
8978 8973 if (fd == -1)
8979 8974 exit(1);
... ...