FreeBSD Bugzilla – Attachment 217091 Details for
Bug 248377
[PATCH] script(1): Enable proper playback [-p] of curses sessions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
2.diff
script.diff (text/plain), 1.11 KB, created by
SOUMENDRA GANGULY
on 2020-08-08 10:49:36 UTC
(
hide
)
Description:
2.diff
Filename:
MIME Type:
Creator:
SOUMENDRA GANGULY
Created:
2020-08-08 10:49:36 UTC
Size:
1.11 KB
patch
obsolete
>--- freebsd/usr.bin/script/script.c 2020-08-08 05:01:12.577372363 -0500 >+++ script.c 2020-08-08 05:43:47.648126214 -0500 >@@ -176,16 +176,16 @@ > if (pflg) > playback(fscript); > >- if ((ttyflg = isatty(STDIN_FILENO)) != 0) { >- 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) >+ if (tcgetattr(STDIN_FILENO, &tt) == -1 || >+ ioctl(STDIN_FILENO, TIOCGWINSZ, &win) == -1) { >+ if (errno != ENOTTY) /* For debugger. */ >+ err(1, "tcgetattr/ioctl"); >+ if (openpty(&master, &slave, NULL, NULL, NULL) == -1) > err(1, "openpty"); > } else { >- if (openpty(&master, &slave, NULL, NULL, NULL) == -1) >+ if (openpty(&master, &slave, NULL, &tt, &win) == -1) > err(1, "openpty"); >+ ttyflg = 1; > } > > if (rawout) >@@ -433,9 +433,8 @@ > struct termios traw; > > if (tcgetattr(STDOUT_FILENO, &tt) == -1) { >- if (errno == EBADF) >- err(1, "%d not valid fd", STDOUT_FILENO); >- /* errno == ENOTTY */ >+ if (errno != ENOTTY) /* For debugger. */ >+ err(1, "tcgetattr"); > return; > } > ttyflg = 1;
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 248377
:
216900
|
216951
|
216973
|
217063
| 217091