diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2022-10-26 18:08:12 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2022-11-02 09:44:48 +0000 |
| commit | 7a254e64bf3d0d7d81f80ffa5ae00cd73deb7e6d (patch) | |
| tree | 1439cf3bbb4e754e79469aeff61425589bd6dace | |
| parent | 9ba17e2d1c2ffc9d00ce020d53523365a0d85f1b (diff) | |
script: Correct -F in man page and usage string.
Sponsored by: Klara, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D37138
(cherry picked from commit 8e096e24d4344b6d3d16e24d58d5d8a0fa9733c9)
script: Add usage string for playback mode.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37138
(cherry picked from commit e7c13cf4383d8216149becf7f843a2e00b30d2e2)
script: Use size_t / ssize_t where needed.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37177
(cherry picked from commit 3276866f40caaf3d5605d5695f460cbdf035ef45)
script: Further usage string nits.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37177
(cherry picked from commit 6ac087cf8ff4de22dc0b1b7ce1248f0a1558ddc2)
script: Handle a missing 's' stamp gracefully.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37182
(cherry picked from commit 473e9fcab4ea9379f53e1f7d8e41f5a5754d0007)
| -rw-r--r-- | usr.bin/script/script.1 | 7 | ||||
| -rw-r--r-- | usr.bin/script/script.c | 12 |
2 files changed, 11 insertions, 8 deletions
diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1 index 36523148fa90..350a5e791e81 100644 --- a/usr.bin/script/script.1 +++ b/usr.bin/script/script.1 @@ -28,7 +28,7 @@ .\" @(#)script.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 9, 2022 +.Dd October 26, 2022 .Dt SCRIPT 1 .Os .Sh NAME @@ -36,8 +36,7 @@ .Nd make typescript of terminal session .Sh SYNOPSIS .Nm -.Op Fl aefkqr -.Op Fl F Ar pipe +.Op Fl aeFfkqr .Op Fl t Ar time .Op Ar file Op Ar command ... .Nm @@ -88,7 +87,7 @@ Accepted for compatibility with .Nm . The child command exit status is always the exit status of .Nm . -.It Fl F Ar pipe +.It Fl F Immediately flush output after each write. This will allow a user to create a named pipe using .Xr mkfifo 1 diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 430f48ad63df..1d3588c26d8b 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -73,8 +73,8 @@ struct stamp { struct buf_elm { TAILQ_ENTRY(buf_elm) link; - int rpos; - int len; + size_t rpos; + size_t len; char ibuf[]; }; @@ -107,7 +107,6 @@ static void usage(void); int main(int argc, char *argv[]) { - int cc; struct termios rtt, stt; struct winsize win; struct timeval tv, *tvp; @@ -116,6 +115,7 @@ main(int argc, char *argv[]) char ibuf[BUFSIZ]; fd_set rfd, wfd; struct buf_elm *be; + ssize_t cc; int aflg, Fflg, kflg, pflg, ch, k, n, fcm; int flushtime, readstdin; int fm_fd, fm_log; @@ -366,7 +366,9 @@ static void usage(void) { (void)fprintf(stderr, - "usage: script [-adfkpqr] [-t time] [file [command ...]]\n"); + "usage: script [-aeFfkpqr] [-t time] [file [command ...]]\n"); + (void)fprintf(stderr, + " script -p [-deq] [-T fmt] [file]\n"); exit(1); } @@ -550,6 +552,8 @@ playback(FILE *fp) tclock = stamp.scr_sec; tso.tv_sec = stamp.scr_sec; tso.tv_nsec = stamp.scr_usec * 1000; + if (nread == 0) + tsi = tso; switch (stamp.scr_direction) { case 's': |
