terminal: set the pty fd non blocking

This commit is contained in:
Shuanglei Tao
2019-12-05 23:19:34 +08:00
parent ca91f40048
commit cfd338ea5e
4 changed files with 25 additions and 4 deletions

View File

@@ -175,6 +175,10 @@ spawn_process(struct pss_tty *pss) {
uv_signal_start(&pss->watcher, child_cb, SIGCHLD);
// ensure the lws socket fd close-on-exec
fd_set_cloexec(lws_get_socket_fd(pss->wsi));
// create process with pseudo-tty
pss->pid = pty_fork(&pss->pty, argv[0], argv, server->terminal_type);
if (pss->pid < 0) {
lwsl_err("pty_fork: %d (%s)\n", errno, strerror(errno));