summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/client.c b/client.c
index bc934d33..ccc58fb4 100644
--- a/client.c
+++ b/client.c
@@ -26,7 +26,6 @@
#include <errno.h>
#include <event.h>
#include <fcntl.h>
-#include <imsg.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
@@ -280,6 +279,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
if ((ttynam = ttyname(STDIN_FILENO)) == NULL)
ttynam = "";
+#ifdef __OpenBSD__
/*
* Drop privileges for client. "proc exec" is needed for -c and for
* locking (which uses system(3)).
@@ -291,6 +291,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
*/
if (pledge("stdio unix sendfd proc exec tty", NULL) != 0)
fatal("pledge failed");
+#endif
/* Free stuff that is not used in the client. */
options_free(global_options);
@@ -311,7 +312,9 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
cfmakeraw(&tio);
tio.c_iflag = ICRNL|IXANY;
tio.c_oflag = OPOST|ONLCR;
+#ifdef NOKERNINFO
tio.c_lflag = NOKERNINFO;
+#endif
tio.c_cflag = CREAD|CS8|HUPCL;
tio.c_cc[VMIN] = 1;
tio.c_cc[VTIME] = 0;
@@ -532,6 +535,7 @@ client_dispatch_wait(struct imsg *imsg)
struct msg_stdout_data stdoutdata;
struct msg_stderr_data stderrdata;
int retval;
+#ifdef __OpenBSD__
static int pledge_applied;
/*
@@ -545,6 +549,7 @@ client_dispatch_wait(struct imsg *imsg)
fatal("pledge failed");
pledge_applied = 1;
};
+#endif
data = imsg->data;
datalen = imsg->hdr.len - IMSG_HEADER_SIZE;