diff options
| -rw-r--r-- | st.c | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -247,7 +247,7 @@ ttynew(void) { | |||
| 247 | if((m = posix_openpt(O_RDWR | O_NOCTTY)) < 0) | 247 | if((m = posix_openpt(O_RDWR | O_NOCTTY)) < 0) |
| 248 | die("openpt failed: %s\n", SERRNO); | 248 | die("openpt failed: %s\n", SERRNO); |
| 249 | if(grantpt(m) < 0) | 249 | if(grantpt(m) < 0) |
| 250 | die("grandpt failed: %s\n", SERRNO); | 250 | die("grantpt failed: %s\n", SERRNO); |
| 251 | if(unlockpt(m) < 0) | 251 | if(unlockpt(m) < 0) |
| 252 | die("unlockpt failed: %s\n", SERRNO); | 252 | die("unlockpt failed: %s\n", SERRNO); |
| 253 | if(!(pts = ptsname(m))) | 253 | if(!(pts = ptsname(m))) |
| @@ -265,7 +265,9 @@ ttynew(void) { | |||
| 265 | dup2(s, STDOUT_FILENO); | 265 | dup2(s, STDOUT_FILENO); |
| 266 | dup2(s, STDERR_FILENO); | 266 | dup2(s, STDERR_FILENO); |
| 267 | if(ioctl(s, TIOCSCTTY, NULL) < 0) | 267 | if(ioctl(s, TIOCSCTTY, NULL) < 0) |
| 268 | die("ioctl TTIOCSTTY failed: %s\n", SERRNO); | 268 | die("ioctl TIOCSCTTY failed: %s\n", SERRNO); |
| 269 | close(s); | ||
| 270 | close(m); | ||
| 269 | execsh(); | 271 | execsh(); |
| 270 | break; | 272 | break; |
| 271 | default: | 273 | default: |
