mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 07:15:59 +01:00
code-style for pledge(2)
feedback from Klemens, thanks
This commit is contained in:
parent
30ce2cc002
commit
235a783e03
1 changed files with 4 additions and 4 deletions
8
st.c
8
st.c
|
@ -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
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue