From: Cyril Hrubis <chrubis@suse.cz>
To: Matus Marhefka <mmarhefk@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/2 v2] added helper tools for creating and working with namespaces
Date: Mon, 27 Jul 2015 16:16:23 +0200 [thread overview]
Message-ID: <20150727141622.GA15383@rei.suse.de> (raw)
In-Reply-To: <1436958370-21366-1-git-send-email-mmarhefk@redhat.com>
Hi!
> +static int child_fn(void *arg)
> +{
> + struct argst *args = arg;
> +
> + execvp(args->argv[2], args->argv+2);
We don't have to pass the argv pointer packed in the struct argst now,
right? Just pass the argv pointer to the clone function in main and cast
it to (char **) here.
...
> + tst_resm(TINFO | TERRNO, "execvp");
> + return 1;
> +}
> + /* gets interface index */
> + if (ioctl(sock_fd, SIOCGIFINDEX, &ifr) == -1) {
> + close(sock_fd);
> + tst_resm(TINFO | TERRNO, "ioctl");
> + return -1;
Technically the close() may clobber the errno before it gets printed. So
ideally we should print the message, then close the sock_fd.
> + }
> +
> + close(sock_fd);
> + return ifr.ifr_ifindex;
> +}
The rest looks fine.
Acked with the minor fixed included.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-07-27 14:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-14 12:22 [LTP] [PATCH 1/2] added helper tools for creating and working with namespaces Matus Marhefka
2015-07-14 12:22 ` [LTP] [PATCH 2/2] containers/netns tests rewritten Matus Marhefka
2015-07-14 13:09 ` Cyril Hrubis
[not found] ` <1436958405-21403-1-git-send-email-mmarhefk@redhat.com>
2015-07-27 14:48 ` [LTP] [PATCH 2/2 v2] " Cyril Hrubis
[not found] ` <1439899125-7646-1-git-send-email-mmarhefk@redhat.com>
2015-08-19 13:44 ` [LTP] [PATCH 2/2 v3] " Cyril Hrubis
[not found] ` <1244717184.10704034.1439998635401.JavaMail.zimbra@redhat.com>
2015-08-19 16:26 ` Cyril Hrubis
[not found] ` <2086887252.11104808.1440076288678.JavaMail.zimbra@redhat.com>
2015-08-20 13:27 ` Cyril Hrubis
[not found] ` <1988094172.11156810.1440082049224.JavaMail.zimbra@redhat.com>
2015-08-20 14:56 ` Cyril Hrubis
2015-07-14 13:02 ` [LTP] [PATCH 1/2] added helper tools for creating and working with namespaces Cyril Hrubis
[not found] ` <1436958370-21366-1-git-send-email-mmarhefk@redhat.com>
2015-07-27 14:16 ` Cyril Hrubis [this message]
[not found] ` <1439899089-7601-1-git-send-email-mmarhefk@redhat.com>
2015-08-26 15:05 ` [LTP] [PATCH 1/2 v3] " Cyril Hrubis
2015-08-27 11:55 ` Cyril Hrubis
[not found] ` <55DF1280.5080300@redhat.com>
2015-08-27 13:47 ` Cyril Hrubis
[not found] ` <55DF19FC.3030501@redhat.com>
2015-08-27 14:13 ` Cyril Hrubis
[not found] ` <55DF1D60.8090702@redhat.com>
2015-08-27 14:26 ` 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=20150727141622.GA15383@rei.suse.de \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=mmarhefk@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox