All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Lock <joshua.g.lock@linux.intel.com>
To: Jiwei Sun <jiwei.sun@windriver.com>, yocto@yoctoproject.org
Subject: Re: [ptest-runner 1/8] Corrected return code interpreter
Date: Tue, 3 Oct 2017 16:31:12 +0100	[thread overview]
Message-ID: <2e003ee6-b5b8-2db6-190e-afaffc2dfa22@linux.intel.com> (raw)
In-Reply-To: <1506650980-87720-1-git-send-email-jiwei.sun@windriver.com>

Can you add a commit message detailing what changed and why? Most of the 
commit messages in this series don't help me understand what changed and 
why: https://chris.beams.io/posts/git-commit/

This is especially important as the original author of the code has 
moved on from the project.

On 29/09/17 03:09, Jiwei Sun wrote:
> Signed-off-by: Jiwei Sun <jiwei.sun@windriver.com>
> ---
>   utils.c | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/utils.c b/utils.c
> index 6d65388..a07faec 100644
> --- a/utils.c
> +++ b/utils.c
> @@ -300,9 +300,19 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid,
>   	}
>   
>   	if (status) {
> -		fprintf(fps[0], "\nERROR: Exit status is %d\n", status);
>   		if (timeouted)
> -			fprintf(fps[0], "TIMEOUT: %s\n", ptest_dir);
> +			fprintf(fps[0], "TIMEOUT: %s ", ptest_dir);
> +
> +		if(WIFEXITED(status)) {
> +			fprintf(fps[0], "\nERROR: Exit status is %d\n", WEXITSTATUS(status));
> +			return WEXITSTATUS(status);
> +		}
> +		else if(WIFSIGNALED(status)) {
> +			fprintf(fps[0], " Killed by signal\n");
> +			return 127;

Why 127? That's "command not found" in bash and EKEYEXPIRED in my errno.h

Could we just include errno and use a named error code?

> +		}
> +		else
> +			fprintf(fps[0], "\nERROR: Exit status is %d\n", status);
>   	}
>   
>   	return status;
> 

Thanks,

Joshua


      parent reply	other threads:[~2017-10-03 15:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29  2:09 [ptest-runner 1/8] Corrected return code interpreter Jiwei Sun
2017-09-29  2:09 ` [ptest-runner 2/8] Add missing stdint.h Jiwei Sun
2017-09-29  2:09 ` [ptest-runner 3/8] Fix linker order for libcheck Jiwei Sun
2017-09-29  2:09 ` [ptest-runner 4/8] Add version(-v) since we change return code ABI Jiwei Sun
2017-09-29  2:09 ` [ptest-runner 5/8] Add parallelism to TC execution Jiwei Sun
2017-10-03 15:31   ` Joshua Lock
2017-09-29  2:09 ` [ptest-runner 6/8] Add <system-out></system-out> to XML when tests fail Jiwei Sun
2017-10-03 15:31   ` Joshua Lock
2017-09-29  2:09 ` [ptest-runner 7/8] Introduce a ret-code for timeouts Jiwei Sun
2017-09-29  2:09 ` [ptest-runner 8/8] Added <system-err></system-err> to XML Jiwei Sun
2017-10-03 15:31   ` Joshua Lock
2017-10-03 15:31 ` Joshua Lock [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=2e003ee6-b5b8-2db6-190e-afaffc2dfa22@linux.intel.com \
    --to=joshua.g.lock@linux.intel.com \
    --cc=jiwei.sun@windriver.com \
    --cc=yocto@yoctoproject.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.