Commit graph

19 commits

Author SHA1 Message Date
Karel Zak
1f58c445c6 script: fix race conditions
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-08-07 00:36:31 +02:00
Karel Zak
7baec9a561 script: improve quiet mode
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-07-24 15:22:57 +02:00
Karel Zak
d057115966 execl() should be use NULL not 0
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-04 14:39:44 +01:00
Karel Zak
baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak
48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
Karel Zak
c129767e06 Imported from util-linux-2.12b tarball. 2006-12-07 00:26:16 +01:00
Karel Zak
df1dddf9ff Imported from util-linux-2.12 tarball. 2006-12-07 00:26:12 +01:00
Karel Zak
a5a16c6853 Imported from util-linux-2.11y tarball. 2006-12-07 00:26:08 +01:00
Karel Zak
ffc4374869 Imported from util-linux-2.11o tarball. 2006-12-07 00:25:53 +01:00
Karel Zak
e8f2641919 Imported from util-linux-2.11m tarball. 2006-12-07 00:25:49 +01:00
Karel Zak
364cda4857 Imported from util-linux-2.11f tarball. 2006-12-07 00:25:48 +01:00
Karel Zak
c07ebfa1e0 Imported from util-linux-2.11b tarball. 2006-12-07 00:25:46 +01:00
Karel Zak
66ee8158b6 Imported from util-linux-2.10s tarball. 2006-12-07 00:25:44 +01:00
Karel Zak
22853e4a82 Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00
Karel Zak
7eda085c41 Imported from util-linux-2.9v tarball. 2006-12-07 00:25:39 +01:00
Karel Zak
5c36a0eb7c Imported from util-linux-2.9i tarball. 2006-12-07 00:25:37 +01:00
Karel Zak
2b6fc908bc Imported from util-linux-2.8 tarball. 2006-12-07 00:25:35 +01:00
Karel Zak
fd6b7a7ffc Imported from util-linux-2.7.1 tarball. 2006-12-07 00:25:34 +01:00
Karel Zak
6dbe3af945 Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00