diff options
author | Aurélien Aptel | 2010-08-26 21:36:21 +0200 |
---|---|---|
committer | Aurélien Aptel | 2010-08-26 21:36:21 +0200 |
commit | cf5b50f54c11258cd36a1584d0ca764af9733dfd (patch) | |
tree | 88be2d0840ec2e9cfa8db41217c6e7aa9dbf52d2 /st.c | |
parent | c78f724fc02b7cac423659432fa3bc0283051d7f (diff) | |
download | aur-cf5b50f54c11258cd36a1584d0ca764af9733dfd.tar.gz |
close master/slave pty in the shell process.
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -247,7 +247,7 @@ ttynew(void) { if((m = posix_openpt(O_RDWR | O_NOCTTY)) < 0) die("openpt failed: %s\n", SERRNO); if(grantpt(m) < 0) - die("grandpt failed: %s\n", SERRNO); + die("grantpt failed: %s\n", SERRNO); if(unlockpt(m) < 0) die("unlockpt failed: %s\n", SERRNO); if(!(pts = ptsname(m))) @@ -265,7 +265,9 @@ ttynew(void) { dup2(s, STDOUT_FILENO); dup2(s, STDERR_FILENO); if(ioctl(s, TIOCSCTTY, NULL) < 0) - die("ioctl TTIOCSTTY failed: %s\n", SERRNO); + die("ioctl TIOCSCTTY failed: %s\n", SERRNO); + close(s); + close(m); execsh(); break; default: |