Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pkg_install/lib Fix timeout in expect():



details:   https://anonhg.NetBSD.org/src/rev/c8e38ea343a3
branches:  trunk
changeset: 499733:c8e38ea343a3
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Tue Nov 28 01:16:01 2000 +0000

description:
Fix timeout in expect():

The FTP coprocess formerly wrote the output of the "get | tar vxf -" pipe
to stderr, which resulted in no output to the feedback pipe (stdout), and
thus the timeout was not updated for any line printed by the "tar" process.
This was now changed to also feed back the chars to the expect() routine,
updating the timeout handler. The "also" part is implemented by passing
the output through "tee /dev/stderr".

At least NetBSD and Solaris have this, so no problem there.

Thanks to Frank van der Linden for helping me to debug this.

diffstat:

 usr.sbin/pkg_install/lib/ftpio.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r e1c509f4f6cd -r c8e38ea343a3 usr.sbin/pkg_install/lib/ftpio.c
--- a/usr.sbin/pkg_install/lib/ftpio.c  Mon Nov 27 23:13:12 2000 +0000
+++ b/usr.sbin/pkg_install/lib/ftpio.c  Tue Nov 28 01:16:01 2000 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: ftpio.c,v 1.26 2000/10/09 14:35:27 hubertf Exp $       */
+/*     $NetBSD: ftpio.c,v 1.27 2000/11/28 01:16:01 hubertf Exp $       */
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ftpio.c,v 1.26 2000/10/09 14:35:27 hubertf Exp $");
+__RCSID("$NetBSD: ftpio.c,v 1.27 2000/11/28 01:16:01 hubertf Exp $");
 #endif
 
 /*
@@ -643,7 +643,7 @@
                        printf("unpackURL '%s' to '%s'\n", url, dir);
 
                /* yes, this is gross, but needed for borken ftp(1) */
-               (void) snprintf(cmd, sizeof(cmd), "get %s \"| ( cd %s ; gunzip 2>/dev/null | tar -%sx >&2 -f - )\"\n", pkg, dir, Verbose?"vv":"");
+               (void) snprintf(cmd, sizeof(cmd), "get %s \"| ( cd %s ; gunzip 2>/dev/null | tar -%sx -f - | tee /dev/stderr )\"\n", pkg, dir, Verbose?"vv":"");
                rc = ftp_cmd(cmd, "\n(226|550).*\n");
                if (rc != 226) {
                        warnx("Cannot fetch file (%d!=226)!", rc);



Home | Main Index | Thread Index | Old Index