From: Christian Limpach <christian.limpach@gmail.com>
To: Rik van Riel <riel@redhat.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] error checking / gcc4
Date: Mon, 12 Sep 2005 21:25:31 +0100 [thread overview]
Message-ID: <3d8eece2050912132540bc5c9f@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0509121619370.14856@cuia.boston.redhat.com>
Thanks!
On 9/12/05, Rik van Riel <riel@redhat.com> 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@redhat.com>
>
> --- 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@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
prev parent reply other threads:[~2005-09-12 20:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 20:20 [PATCH] error checking / gcc4 Rik van Riel
2005-09-12 20:25 ` Christian Limpach [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d8eece2050912132540bc5c9f@mail.gmail.com \
--to=christian.limpach@gmail.com \
--cc=Christian.Limpach@cl.cam.ac.uk \
--cc=riel@redhat.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.