public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [RFC] [PATCH] lib/tst_mkfs: Exit with TCONF on missing mkfs.foo
Date: Tue, 26 Apr 2016 12:23:33 -0400 (EDT)	[thread overview]
Message-ID: <2047893553.473657.1461687813294.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160426122824.GB6766@rei.lan>





----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Tuesday, 26 April, 2016 2:28:25 PM
> Subject: Re: [LTP] [RFC] [PATCH] lib/tst_mkfs: Exit with TCONF on missing mkfs.foo
> 
> Hi!
> > diff --git a/lib/tst_run_cmd.c b/lib/tst_run_cmd.c
> > index a54d46878940..e58b639e94af 100644
> > --- a/lib/tst_run_cmd.c
> > +++ b/lib/tst_run_cmd.c
> > @@ -71,7 +71,12 @@ int tst_run_cmd_fds_(void (cleanup_fn)(void),
> >                         dup2(stderr_fd, STDERR_FILENO);
> >                 }
> >  
> > -               _exit(execvp(argv[0], (char *const *)argv));
> > +               if (execvp(argv[0], (char *const *)argv) == -1) {
> > +                       if (errno == ENOENT)
> > +                               _exit(255);
> > +                       else
> > +                               _exit(errno);
> 
> I'm not 100% sure if we want to set the errno as an exit value since for
> instance EPERM == 1 which would be indistinguishable from most of the
> command failures.
> 
> Maybe we can exit with 255 on ENOENT and with 254 otherwise.

Fine by me, I just wanted to avoid hiding every error under TCONF.

Regards,
Jan

> 
> --
> Cyril Hrubis
> chrubis@suse.cz
> 

  reply	other threads:[~2016-04-26 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 11:00 [LTP] [RFC] [PATCH] lib/tst_mkfs: Exit with TCONF on missing mkfs.foo Cyril Hrubis
2016-04-26 11:47 ` Jan Stancek
2016-04-26 12:28   ` Cyril Hrubis
2016-04-26 16:23     ` Jan Stancek [this message]
2016-04-27 12:02       ` Cyril Hrubis

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=2047893553.473657.1461687813294.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox