On Thu, May 10 2018, Nan Xiao <[email protected]> wrote:
> Hi tech@,

Hi,

> Following is a trivial modification of tcpbench.c, and I think use err
> is more better than errx. Apologize if I am wrong, thanks!

I think the preferred idiom is err(1, NULL);

> Index: tcpbench.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/tcpbench/tcpbench.c,v
> retrieving revision 1.52
> diff -u -p -r1.52 tcpbench.c
> --- tcpbench.c        19 Sep 2016 18:58:39 -0000      1.52
> +++ tcpbench.c        10 May 2018 09:41:42 -0000
> @@ -1041,7 +1041,7 @@ main(int argc, char **argv)
>                       exit(0);
>               case 'k':
>                       if ((tmp = strdup(optarg)) == NULL)
> -                             errx(1, "strdup");
> +                             err(1, "strdup");
>                       ptb->kvars = check_prepare_kvars(tmp);
>                       free(tmp);
>                       break;

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to