WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] error checking / gcc4

To: Rik van Riel <riel@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] error checking / gcc4
From: Christian Limpach <christian.limpach@xxxxxxxxx>
Date: Mon, 12 Sep 2005 21:25:31 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 12 Sep 2005 20:23:25 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sxWr1M8SS0+7N6I0lT5Nr4/7VGnaFGiLiM8P6ZF+gR87p7dKoOMRxNCV3zy9c7/xBQs6o5vSJxX7NrANV+2XB5A7cS6LpEUE06og38jmHbbTbGjSiZZGILKYQ49GAaxVpmeWiqPx05ERX5905lBdVJc4PLYQjZ1Xn+WTIz/+2fs=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <Pine.LNX.4.63.0509121619370.14856@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <Pine.LNX.4.63.0509121619370.14856@xxxxxxxxxxxxxxxxxxxxxx>
Reply-to: Christian.Limpach@xxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thanks!

On 9/12/05, Rik van Riel <riel@xxxxxxxxxx> wrote:
> There are a few more places where gcc4 complains about not
> checking the return value of certain calls.  This trivial
> patch adds error checking to tools/console/daemon/utils.c
> 
> Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>
> 
> --- xen-unstable/tools/console/daemon/utils.c.gcc4      2005-09-07 
> 11:14:24.000000000 -0400
> +++ xen-unstable/tools/console/daemon/utils.c   2005-09-07 11:16:21.000000000 
> -0400
> @@ -105,7 +105,9 @@
>        close(fd);
> 
>        umask(027);
> -       chdir("/");
> +       if (chdir("/") < 0) {
> +               exit(1);
> +       }
> 
>        fd = open(pidfile, O_RDWR | O_CREAT);
>        if (fd == -1) {
> @@ -117,7 +119,9 @@
>        }
> 
>        len = sprintf(buf, "%d\n", getpid());
> -       write(fd, buf, len);
> +       if (write(fd, buf, len) < 0) {
> +               exit(1);
> +       }
> 
>        signal(SIGCHLD, child_exit);
>        signal(SIGTSTP, SIG_IGN);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>