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
chru...@suse.cz

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to