| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -101,20 +101,8 @@ def fork(): | |||
| 101 | 101 | master_fd, slave_fd = openpty() | |
| 102 | 102 | pid = os.fork() | |
| 103 | 103 | if pid == CHILD: | |
| 104 | - # Establish a new session. | ||
| 105 | - os.setsid() | ||
| 106 | 104 | os.close(master_fd) | |
| 107 | - | ||
| 108 | - # Slave becomes stdin/stdout/stderr of child. | ||
| 109 | - os.dup2(slave_fd, STDIN_FILENO) | ||
| 110 | - os.dup2(slave_fd, STDOUT_FILENO) | ||
| 111 | - os.dup2(slave_fd, STDERR_FILENO) | ||
| 112 | - if slave_fd > STDERR_FILENO: | ||
| 113 | - os.close(slave_fd) | ||
| 114 | - | ||
| 115 | - # Explicitly open the tty to make it become a controlling tty. | ||
| 116 | - tmp_fd = os.open(os.ttyname(STDOUT_FILENO), os.O_RDWR) | ||
| 117 | - os.close(tmp_fd) | ||
| 105 | + os.login_tty(slave_fd) | ||
| 118 | 106 | else: | |
| 119 | 107 | os.close(slave_fd) | |
| 120 | 108 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments