feedback from Klemens, thanks
#include <libutil.h>
#endif
-#ifndef __OpenBSD__
-#define pledge(a,b) 0
-#endif
-
/* Arbitrary sizes */
#define UTF_INVALID 0xFFFD
#define UTF_SIZ 4
die("ioctl TIOCSCTTY failed: %s\n", strerror(errno));
close(s);
close(m);
+#ifdef __OpenBSD__
if (pledge("stdio getpw proc exec", NULL) == -1)
die("pledge\n");
+#endif
execsh(cmd, args);
break;
default:
+#ifdef __OpenBSD__
if (pledge("stdio rpath tty proc", NULL) == -1)
die("pledge\n");
+#endif
close(s);
cmdfd = m;
signal(SIGCHLD, sigchld);