From: Petr Rockai <prockai@redhat.com>
To: lvm-devel@redhat.com
Subject: LVM2/test Makefile.in test-utils.sh not.c
Date: Mon, 12 Jan 2009 19:54:56 +0100 [thread overview]
Message-ID: <87bpuc4anz.fsf@eriador.mornfall.net> (raw)
In-Reply-To: <20090112184545.13175.qmail@sourceware.org> (mornfall@sourceware.org's message of "12 Jan 2009 18:45:45 -0000")
Err.
mornfall at sourceware.org writes:
> + pid = fork();
> + if (pid == -1) {
> + fprintf(stderr, "Could not fork\n");
> + return FAILURE;
> + } else if (pid == 0) { /* child */
> + execvp(argv[1], &argv[1]);
> + /* should not be accessible */
> + return FAILURE;
This should probably be return SUCCESS or abort() I guess. This will turn
command not found and other unexpected failures to overall not failures (these
are treated as successes, thanks to the parent's reinterpretation of exit
code). (This still ain't a regression, I believe, though.) Opinions?
> + } else { /* parent */
> + waitpid(pid, &status, 0);
> + if (!WIFEXITED(status)) {
> + /* did not exit correctly */
> + return FAILURE;
> + }
> + /* return the opposite */
> + return !WEXITSTATUS(status);
> + }
> + /* not accessible */
> + return FAILURE;
Yours,
Petr.
--
Peter Rockai | me()mornfall!net | prockai()redhat!com
http://blog.mornfall.net | http://web.mornfall.net
"In My Egotistical Opinion, most people's C programs should be
indented six feet downward and covered with dirt."
-- Blair P. Houghton on the subject of C program indentation
prev parent reply other threads:[~2009-01-12 18:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 18:45 LVM2/test Makefile.in test-utils.sh not.c mornfall
2009-01-12 18:54 ` Petr Rockai [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=87bpuc4anz.fsf@eriador.mornfall.net \
--to=prockai@redhat.com \
--cc=lvm-devel@redhat.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.