Re: Pledge error handling

2016-04-15 Thread Theo de Raadt
>I noticed there are (at least 2) diferent ways to handle a pledge error (eg= >: /usr/src/usr.bin/): >If (pledge(args, NULL) =3D=3D -1) >. err(1, "pledge"); (wc; w; ..) >. perror("pledge"); exit(EXIT_CODE); (vi; openssl; ...) > >I am not familiar with the case of use of each function but perror + e

Re: Pledge error handling

2016-04-03 Thread Héctor Luis Gimbatti
For the specific case of openssl: It uses perror with only one exception for which I include a diff below. It would be no hard to replace each perror(str) + exit(1) by err(1, str) I don’t know which is better Cheers Index: openssl.c

Re: Pledge error handling

2016-04-03 Thread Michael McConville
Héctor Luis Gimbatti wrote: > I noticed there are (at least 2) diferent ways to handle a pledge > error (eg: /usr/src/usr.bin/): > > If (pledge(args, NULL) == -1) > . err(1, "pledge"); (wc; w; ..) > . perror("pledge"); exit(EXIT_CODE); (vi; openssl; ...) > > I am not familiar with the case of use

Pledge error handling

2016-04-03 Thread Héctor Luis Gimbatti
Greetings, I noticed there are (at least 2) diferent ways to handle a pledge error (eg: /usr/src/usr.bin/): If (pledge(args, NULL) == -1) . err(1, "pledge"); (wc; w; ..) . perror("pledge"); exit(EXIT_CODE); (vi; openssl; ...) I am not familiar with the case of use of each function but perror + e