Open /dev/ptm before pledge() and save it to be used for PTMGET later

(this means inlining forkpty()).

ok deraadt
This commit is contained in:
nicm
2017-01-23 10:09:43 +00:00
parent 4ede35c48c
commit 98e7fbb2ac
6 changed files with 79 additions and 1 deletions

5
tmux.h
View File

@@ -1501,6 +1501,7 @@ extern struct options *global_w_options;
extern struct environ *global_environ;
extern struct timeval start_time;
extern const char *socket_path;
extern int ptm_fd;
int areshell(const char *);
void setblocking(int, int);
const char *find_home(void);
@@ -2329,4 +2330,8 @@ void style_apply_update(struct grid_cell *, struct options *,
int style_equal(const struct grid_cell *,
const struct grid_cell *);
/* pty.c */
int pty_open(int *);
pid_t pty_fork(int, int *, char *, size_t, struct winsize *);
#endif /* TMUX_H */