diff options
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -254,10 +254,6 @@ client_main(struct event_base *base, int argc, char **argv, int flags) cmd_list_free(cmdlist); } - /* Set process title, log and signals now this is the client. */ - setproctitle("client (%s)", socket_path); - logfile("client"); - /* Establish signal handlers. */ set_signals(client_signal); @@ -280,6 +276,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 +288,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); @@ -298,6 +296,12 @@ client_main(struct event_base *base, int argc, char **argv, int flags) options_free(&global_w_options); environ_free(&global_environ); + /* Set process title, log and signals now this is the client. */ +#ifdef HAVE_SETPROCTITLE + setproctitle("client (%s)", socket_path); +#endif + logfile("client"); + /* Create imsg. */ imsg_init(&client_ibuf, fd); event_set(&client_event, fd, EV_READ, client_callback, NULL); @@ -315,7 +319,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; @@ -601,6 +607,7 @@ client_dispatch_wait(void) struct msg_stdout_data stdoutdata; struct msg_stderr_data stderrdata; int retval; +#ifdef __OpenBSD__ static int pledge_applied; /* @@ -614,6 +621,7 @@ client_dispatch_wait(void) fatal("pledge failed"); pledge_applied = 1; }; +#endif for (;;) { if ((n = imsg_get(&client_ibuf, &imsg)) == -1) |