summaryrefslogtreecommitdiff
path: root/misc-utils/script.c
AgeCommit message (Collapse)AuthorFilesLines
2012-01-22#include <fcntl.h>Igor Pashev1-0/+1
2012-01-21Use static cfmakeraw() if not systemIgor Pashev1-0/+12
2010-07-26portability: fix mntent.h and pty.h usageFrançois Revol1-3/+3
Signed-off-by: François Revol <revol@free.fr> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-29script: optionally compile with libutempter to update utmpKarel Zak1-2/+18
Use --with-utempter to enable utempter support. The libutempter calls /usr/libexec/utempter/utempter suid helper to update utmp and wtmp files. Old version: $ script Script started, file is typescript $ who i am $ exit Script done, file is typescript New version: $ script Script started, file is typescript $ who i am kzak pts/6 2010-04-29 12:30 $ exit Script done, file is typescript Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=477753 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-27script: preserve child exit statusKarel Zak1-18/+30
The patch also removes unnecessary detection of child process existence (by kill()). This code was replaces with SIGCHLD hold/release around fork(). Based on the patch from therealneworld@gmail.com. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-30include: clean up _PATH_DEV_* macrosKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-05script: don't flush input when starting scriptAndrew McGill1-3/+3
script currently flushed the input buffer when starting up. This undocumented behaviour prevents typeahead when starting up (e.g. as part of .profile). Rather retain queued input. Don't discard queued output either. Signed-off-by: Andrew McGill <andrew@lunch.za.net>
2008-07-28misc-utils: write include signal.h directlymaximilian attems1-1/+1
another small step for better klibc support, glibc compile tested. Signed-off-by: maximilian attems <max@stro.at>
2008-04-08script: read returns a size_tJames Youngman1-2/+2
Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-31Revert "script: improve quiet mode"Karel Zak1-2/+1
This reverts commit 7baec9a5612358559d1556113657223a64e373d1. Note, scriptreplay(8) expects the "Script started on.." line. We cannot remove this message...
2007-11-28script: cleanup includesSamuel Thibault1-4/+4
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-05script: cleanup gcc warningsRandy Dunlap1-5/+26
Fix strict gcc warnings that come from using: ("-Wall -Wp,-D_FORTIFY_SOURCE=2") script.c:239: warning: ignoring return value of 'write', declared with attribute warn_unused_result script.c:330: warning: ignoring return value of 'write', declared with attribute warn_unused_result script.c:331: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-05script: dies on SIGWINCHKarel Zak1-4/+10
The "doinput" process doesn't make a difference between SIGWINCH and SIGCHILD. This process also sends unnecessary SIGWINCH to child (the signal is ignored by child). Fixed. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-07script: fix race conditionsKarel Zak1-10/+52
script(1) uses three processes (doinput, dooutput and doshell). It's possible that the shell process is finished before the input and output processes are completely initialized. For example: $ script -c "printf Bingo" In particular case the output and input processes read/write data from shell process in time when the shell process is already done -- so it hangs on read(). The second problem is that the output process can finish although there are unread data from finished shell process -- an output in the typescript file and on terminal is incomplete! script(1) has to pass: $ for i in `seq 1 1000`; do script -q -c "printf 'Bingo\n'"; done | grep -c Bingo 1000 without problems. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-24script: improve quiet modeKarel Zak1-1/+2
script(1) is not consistent and writes "Script started on.." to scriptfile, although the others messages are ignored when running with '-q'. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-04execl() should be use NULL not 0Karel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2006-12-07Imported from util-linux-2.13-pre2 tarball.Karel Zak1-2/+2
2006-12-07Imported from util-linux-2.13-pre1 tarball.Karel Zak1-9/+8
2006-12-07Imported from util-linux-2.12b tarball.Karel Zak1-0/+10
2006-12-07Imported from util-linux-2.12 tarball.Karel Zak1-8/+22
2006-12-07Imported from util-linux-2.11y tarball.Karel Zak1-5/+17
2006-12-07Imported from util-linux-2.11o tarball.Karel Zak1-5/+5
2006-12-07Imported from util-linux-2.11m tarball.Karel Zak1-2/+15
2006-12-07Imported from util-linux-2.11f tarball.Karel Zak1-4/+13
2006-12-07Imported from util-linux-2.11b tarball.Karel Zak1-1/+1
2006-12-07Imported from util-linux-2.10s tarball.Karel Zak1-11/+63
2006-12-07Imported from util-linux-2.10m tarball.Karel Zak1-30/+18
2006-12-07Imported from util-linux-2.9v tarball.Karel Zak1-14/+24
2006-12-07Imported from util-linux-2.9i tarball.Karel Zak1-2/+26
2006-12-07Imported from util-linux-2.8 tarball.Karel Zak1-11/+0
2006-12-07Imported from util-linux-2.7.1 tarball.Karel Zak1-3/+21
2006-12-07Imported from util-linux-2.2 tarball.Karel Zak1-0/+294