Joey Hess wrote: > My patch for this bug causes ttyrec to wait after the process > has exited, until the user hits a key. That's broken..
Updated patch fixes this, by just closing the input fd when the child exits. -- see shy jo
diff --git a/ttyrec.c b/ttyrec.c
index 3392f70..56628fa 100644
--- a/ttyrec.c
+++ b/ttyrec.c
@@ -193,8 +193,9 @@ doinput()
#ifdef HAVE_openpty
(void) close(slave);
#endif
- while ((cc = read(0, ibuf, BUFSIZ)) > 0)
+ while ((cc = read(0, ibuf, BUFSIZ)) > 0) {
(void) write(master, ibuf, cc);
+ }
done();
}
@@ -209,14 +210,10 @@ finish()
union wait status;
#endif /* !SVR4 */
register int pid;
- register int die = 0;
while ((pid = wait3((int *)&status, WNOHANG, 0)) > 0)
if (pid == child)
- die = 1;
-
- if (die)
- done();
+ close(0);
}
struct linebuf {
signature.asc
Description: Digital signature

