From: Jakub Jelinek <jakub@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: Michael Kerrisk <mtk-lkml@gmx.net>,
torvalds@osdl.org, akpm@osdl.org, drepper@redhat.com,
linux-kernel@vger.kernel.org, michael.kerrisk@gmx.net,
Tonnerre <tonnerre@thundrix.ch>
Subject: Re: [PATCH] waitid system call
Date: Tue, 31 Aug 2004 02:26:56 -0400 [thread overview]
Message-ID: <20040831062656.GU11465@devserv.devel.redhat.com> (raw)
In-Reply-To: <200408310604.i7V64k7o010652@magilla.sf.frob.com>
On Mon, Aug 30, 2004 at 11:04:46PM -0700, Roland McGrath wrote:
> + /*
> + * For a WNOHANG return, clear out all the fields
> + * we would set so the user can easily tell the
> + * difference.
> + */
> + if (!retval)
> + retval = put_user(0, &infop->si_signo);
> + if (!retval)
> + retval = put_user(0, &infop->si_errno);
> + if (!retval)
> + retval = put_user(0, &infop->si_code);
> + if (!retval)
> + retval = put_user(0, &infop->si_pid);
> + if (!retval)
> + retval = put_user(0, &infop->si_uid);
> + if (!retval)
> + retval = put_user(0, &infop->si_status);
Is it really necessary to check the exit code after each put_user?
if (!retval && access_ok(VERIFY_WRITE, infop, sizeof(*infop)))) {
retval = __put_user(0, &infop->si_signo);
retval |= __put_user(0, &infop->si_errno);
retval |= __put_user(0, &infop->si_code);
retval |= __put_user(0, &infop->si_pid);
retval |= __put_user(0, &infop->si_uid);
retval |= __put_user(0, &infop->si_status);
}
is what kernel usually does when filling multiple structure members.
Jakub
next prev parent reply other threads:[~2004-08-31 6:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-15 23:03 [PATCH] waitid system call Roland McGrath
2004-08-16 5:40 ` Roland McGrath
2004-08-16 17:15 ` Michael Kerrisk
2004-08-16 21:12 ` Roland McGrath
2004-08-19 17:20 ` Michael Kerrisk
2004-08-19 20:53 ` Roland McGrath
2004-08-20 6:00 ` Michael Kerrisk
2004-08-20 9:02 ` Michael Kerrisk
2004-08-20 20:04 ` Roland McGrath
2004-08-24 11:51 ` Michael Kerrisk
2004-08-31 6:04 ` Roland McGrath
2004-08-31 6:26 ` Jakub Jelinek [this message]
2004-08-31 6:37 ` Roland McGrath
2004-08-31 6:40 ` Andrew Morton
2004-08-31 15:53 ` Bill Davidsen
2004-08-31 18:26 ` Linus Torvalds
2004-08-31 23:51 ` Roland McGrath
2004-09-01 11:31 ` Michael Kerrisk
2004-08-31 7:22 ` Michael Kerrisk
2004-08-22 8:53 ` Tonnerre
[not found] <2tCiy-8pK-13@gated-at.bofh.it>
2004-08-16 0:03 ` Andi Kleen
2004-08-16 2:10 ` Roland McGrath
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=20040831062656.GU11465@devserv.devel.redhat.com \
--to=jakub@redhat.com \
--cc=akpm@osdl.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.kerrisk@gmx.net \
--cc=mtk-lkml@gmx.net \
--cc=roland@redhat.com \
--cc=tonnerre@thundrix.ch \
--cc=torvalds@osdl.org \
/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.