peek(1): warn on pledge(2) or unveil(2) errors
This commit is contained in:
parent
3f41110617
commit
7d174c1f7c
@ -62,8 +62,11 @@ usage(char *argv0) {
|
|||||||
|
|
||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
pledge("stdio tty unveil", NULL);
|
if (pledge("stdio tty unveil", "") != 0 || unveil(NULL, NULL) != 0) {
|
||||||
unveil(NULL, NULL);
|
/* This isn't fatal; these return values could be cast to void just as
|
||||||
|
* easily. */
|
||||||
|
(void)perror(argv[0] == NULL ? argv[0] : program_name);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (argc > 0) { /* option parsing */
|
if (argc > 0) { /* option parsing */
|
||||||
|
Loading…
Reference in New Issue
Block a user