script: make it work even if fd 0 is closed
Testcase: script -q -c "echo hey" /dev/null 0>&- Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -16,7 +16,7 @@ int FAST_FUNC xgetpty(char *line)
|
||||
|
||||
#if ENABLE_FEATURE_DEVPTS
|
||||
p = open("/dev/ptmx", O_RDWR);
|
||||
if (p > 0) {
|
||||
if (p >= 0) {
|
||||
grantpt(p); /* chmod+chown corresponding slave pty */
|
||||
unlockpt(p); /* (what does this do?) */
|
||||
# ifndef HAVE_PTSNAME_R
|
||||
|
Reference in New Issue
Block a user