npc(1): tweak OpenBSD functions
This commit is contained in:
parent
10b7f7706b
commit
da190f713c
20
src/npc.c
20
src/npc.c
@ -39,22 +39,20 @@ usage(char *argv0) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
#ifdef __OpenBSD__
|
||||
program_name = argv[0] == NULL ? program_name : argv[0];
|
||||
|
||||
if (pledge("stdio", NULL) == -1) {
|
||||
perror(program_name);
|
||||
return EX_OSERR;
|
||||
}
|
||||
#endif
|
||||
int c;
|
||||
char showend = 0; /* print a dollar sign before each newline */
|
||||
char showtab = 0; /* prints tab characters in caret notation */
|
||||
|
||||
if (argc > 0) {
|
||||
#ifndef __OpenBSD__
|
||||
program_name = argv[0];
|
||||
#ifdef __OpenBSD__
|
||||
if (pledge("stdio", NULL) == -1) {
|
||||
perror(argv[0] == NULL ? program_name : argv[0]);
|
||||
return EX_OSERR;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (argc > 0) {
|
||||
program_name = argv[0];
|
||||
|
||||
while ((c = getopt(argc, argv, "et")) != -1) {
|
||||
switch (c){
|
||||
case 'e': showend = 1; break;
|
||||
|
Loading…
Reference in New Issue
Block a user