Skip to content

Commit

Permalink
Remove usage of sysexits.h
Browse files Browse the repository at this point in the history
A recent discussion on the OpenBSD tech-mailing-list[1] brought to my
attention that sysexits.h originates from sendmail(8) and further usage
is not encouraged.

[1] http://marc.info/?l=openbsd-tech&m=149191614721371&w=2
  • Loading branch information
mptre committed Apr 11, 2017
1 parent fd824f5 commit e3a5207
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions pick.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include <termios.h>
#include <unistd.h>
#include <wchar.h>
Expand All @@ -26,9 +25,6 @@

#include "compat.h"

#define EX_SIG 128
#define EX_SIGINT (EX_SIG + SIGINT)

#define tty_putp(capability, fatal) do { \
if (tputs(capability, 1, tty_putc) == ERR && fatal) \
errx(1, #capability ": unknown terminfo capability"); \
Expand Down Expand Up @@ -135,7 +131,7 @@ main(int argc, char **argv)
break;
case 'v':
puts(PACKAGE_VERSION);
exit(EX_OK);
exit(0);
case 'x':
use_alternate_screen = 1;
break;
Expand Down Expand Up @@ -176,7 +172,7 @@ main(int argc, char **argv)
free(choices.v);
free(query);

return EX_OK;
return 0;
}

__dead void
Expand All @@ -192,7 +188,7 @@ usage(void)
" -X disable alternate screen\n"
" -q query supply an initial search query\n");

exit(EX_USAGE);
exit(1);
}

char *
Expand Down Expand Up @@ -635,7 +631,7 @@ void
handle_sigint(int sig __attribute__((unused)))
{
tty_restore();
exit(EX_SIGINT);
exit(1);
}

void
Expand Down
2 changes: 1 addition & 1 deletion tests/06.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
description: unknown option
args: -0
exit: 64
exit: 1
2 changes: 1 addition & 1 deletion tests/19.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
description: extra argument
args: a
exit: 64
exit: 1

0 comments on commit e3a5207

Please sign in to comment.