use pledge by default if compiled on openbsc and provide errno string
This commit is contained in:
parent
a4434536cd
commit
584290f264
@ -26,5 +26,3 @@ CC = cc
|
||||
CFLAGS = -g -O0 -W -Wall ${INCLUDES} -DVERSION=\"${VERSION}\"
|
||||
LDFLAGS = ${LIBS}
|
||||
|
||||
# OpenBSD pledge(2) support
|
||||
# CFLAGS+= -DUSE_PLEDGE
|
||||
|
4
ii.c
4
ii.c
@ -491,9 +491,9 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
irc = tcpopen(port);
|
||||
|
||||
#ifdef USE_PLEDGE /* OpenBSD pledge(2) support */
|
||||
#ifdef __OpenBSD__ /* OpenBSD pledge(2) support */
|
||||
if (pledge("stdio rpath wpath cpath dpath", NULL) == -1) {
|
||||
fputs("ii: pledge\n", stderr);
|
||||
eprint("ii pledge:");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user