FreeBSD Bugzilla – Attachment 35588 Details for
Bug 57414
/usr/bin/script fails silently if stdin is not a terminal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 943 bytes, created by
Jonathan Lennox
on 2003-09-30 19:20:17 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Jonathan Lennox
Created:
2003-09-30 19:20:17 UTC
Size:
943 bytes
patch
obsolete
>--- usr.bin/script/script.1.orig Tue Sep 30 14:02:29 2003 >+++ usr.bin/script/script.1 Tue Sep 30 14:06:29 2003 >@@ -155,3 +155,7 @@ > mode, echo cancelling is far from ideal. The slave terminal mode is checked > for ECHO mode to check when to avoid manual echo logging. This does not > work when in a raw mode where the program being run is doing manual echo. >+.Pp >+The >+.Nm >+utility fails if the standard input is not a terminal. >--- usr.bin/script/script.c.orig Tue Sep 30 14:01:46 2003 >+++ usr.bin/script/script.c Tue Sep 30 14:04:48 2003 >@@ -126,8 +126,10 @@ > if ((fscript = fopen(fname, aflg ? "a" : "w")) == NULL) > err(1, "%s", fname); > >- (void)tcgetattr(STDIN_FILENO, &tt); >- (void)ioctl(STDIN_FILENO, TIOCGWINSZ, &win); >+ if (tcgetattr(STDIN_FILENO, &tt) == -1) >+ err(1, "tcgetattr"); >+ if (ioctl(STDIN_FILENO, TIOCGWINSZ, &win) == -1) >+ err(1, "ioctl"); > if (openpty(&master, &slave, NULL, &tt, &win) == -1) > err(1, "openpty");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 57414
: 35588