From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JM30B-0003gx-9b for qemu-devel@nongnu.org; Mon, 04 Feb 2008 10:12:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JM309-0003g7-Ol for qemu-devel@nongnu.org; Mon, 04 Feb 2008 10:12:54 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JM309-0003g2-Lj for qemu-devel@nongnu.org; Mon, 04 Feb 2008 10:12:53 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JM309-0006GU-TT for qemu-devel@nongnu.org; Mon, 04 Feb 2008 10:12:54 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e4.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m14FBDYP024046 for ; Mon, 4 Feb 2008 10:11:13 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m14FBDkD245516 for ; Mon, 4 Feb 2008 10:11:13 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m14FBCPr011886 for ; Mon, 4 Feb 2008 10:11:13 -0500 From: Anthony Liguori Date: Mon, 4 Feb 2008 09:11:03 -0600 Message-Id: <1202137865-20232-4-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1202137865-20232-1-git-send-email-aliguori@us.ibm.com> References: <1202137865-20232-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 3/5] Fix daemonize options (v2) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel@lists.sourceforge.net, Paul Brook The -daemonize option is too restrictive when using with SDL. It also switches the working directory to / too early which causes block devices with a relative path to fail. The -daemonize option is needed for my regression testing so I've included this patch in the series. This patch hasn't changed since v1. diff --git a/vl.c b/vl.c index 7dcddf3..28d6f6c 100644 --- a/vl.c +++ b/vl.c @@ -8757,11 +8757,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; @@ -8799,7 +8794,6 @@ int main(int argc, char **argv) exit(1); umask(027); - chdir("/"); signal(SIGTSTP, SIG_IGN); signal(SIGTTOU, SIG_IGN); @@ -9065,6 +9059,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);