npc(1): uses perror(3)
This commit is contained in:
parent
ea2efdf5b9
commit
d6d9c2088e
@ -22,11 +22,6 @@
|
|||||||
#include <sysexits.h> /* EX_IOERR, EX_OK, EX_OSERR, EX_USAGE */
|
#include <sysexits.h> /* EX_IOERR, EX_OK, EX_OSERR, EX_USAGE */
|
||||||
#include <unistd.h> /* pledge(2), getopt(3) */
|
#include <unistd.h> /* pledge(2), getopt(3) */
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
|
||||||
# include <errno.h> /* errno */
|
|
||||||
# include <string.h> /* strerror(3) */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char *program_name = "npc";
|
char *program_name = "npc";
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -48,7 +43,7 @@ int main(int argc, char *argv[]) {
|
|||||||
program_name = argv[0] == NULL ? program_name : argv[0];
|
program_name = argv[0] == NULL ? program_name : argv[0];
|
||||||
|
|
||||||
if (pledge("stdio", NULL) == -1) {
|
if (pledge("stdio", NULL) == -1) {
|
||||||
(void)fprintf(stderr, "%s: %s\n", program_name, strerror(errno));
|
perror(program_name);
|
||||||
return EX_OSERR;
|
return EX_OSERR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user