Skip to content

Commit

Permalink
code-style for pledge(2)
Browse files Browse the repository at this point in the history
feedback from Klemens, thanks
  • Loading branch information
hiltjo committed May 25, 2018
1 parent 30ce2cc commit 235a783
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions st.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
#include <libutil.h>
#endif

#ifndef __OpenBSD__
#define pledge(a,b) 0
#endif

/* Arbitrary sizes */
#define UTF_INVALID 0xFFFD
#define UTF_SIZ 4
Expand Down Expand Up @@ -810,13 +806,17 @@ ttynew(char *line, char *cmd, char *out, char **args)
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);
Expand Down

0 comments on commit 235a783

Please sign in to comment.