From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nn7HX-0007vD-R1 for qemu-devel@nongnu.org; Thu, 04 Mar 2010 04:23:47 -0500 Received: from [199.232.76.173] (port=42870 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nn7HX-0007ug-0w for qemu-devel@nongnu.org; Thu, 04 Mar 2010 04:23:47 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nn7HV-0000E4-SZ for qemu-devel@nongnu.org; Thu, 04 Mar 2010 04:23:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44816) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nn7HV-0000Ds-GV for qemu-devel@nongnu.org; Thu, 04 Mar 2010 04:23:45 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o249NirW008929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Mar 2010 04:23:44 -0500 Date: Thu, 4 Mar 2010 11:20:24 +0200 From: "Michael S. Tsirkin" Message-ID: <20100304092024.GA1535@redhat.com> References: <93c1dcb48b0cfa33775fc45a1ffb9c0edb44d833.1267692963.git.quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <93c1dcb48b0cfa33775fc45a1ffb9c0edb44d833.1267692963.git.quintela@redhat.com> Subject: [Qemu-devel] Re: [PATCH 02/10] slirp: check system() success List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On Thu, Mar 04, 2010 at 10:00:31AM +0100, Juan Quintela wrote: > we shouldn't call W*() macros until we check that fork worked. > > Signed-off-by: Juan Quintela Acked-by: Michael S. Tsirkin > --- > net/slirp.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/net/slirp.c b/net/slirp.c > index 317cca7..7f846ec 100644 > --- a/net/slirp.c > +++ b/net/slirp.c > @@ -472,7 +472,7 @@ static void slirp_smb_cleanup(SlirpState *s) > if (s->smb_dir[0] != '\0') { > snprintf(cmd, sizeof(cmd), "rm -rf %s", s->smb_dir); > ret = system(cmd); > - if (!WIFEXITED(ret)) { > + if (ret == -1 || !WIFEXITED(ret)) { > qemu_error("'%s' failed.\n", cmd); > } else if (WEXITSTATUS(ret)) { > qemu_error("'%s' failed. Error code: %d\n", > -- > 1.6.6.1 > >