Date: Fri, 14 Feb 1997 18:25:48 -0800 (PST) From: graphix@iastate.edu To: freebsd-gnats-submit@freebsd.org Subject: bin/2739: fetch prints messages to stdout even when receiving file to stdout Message-ID: <199702150225.SAA21258@freefall.freebsd.org> Resent-Message-ID: <199702150230.SAA21441@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 2739 >Category: bin >Synopsis: fetch prints messages to stdout even when receiving file to stdout >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 14 18:30:01 PST 1997 >Last-Modified: >Originator: Kent Vander Velden >Organization: Iowa State University >Release: 3.0-Current >Environment: FreeBSD pseudo.cc.iastate.edu 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Sun Feb 9 02:37:42 CST 1997 kent@pseudo.cc.iastate.edu:/usr/src/sys/compile/PSEUDO i386 >Description: Fetch will print messages to stdout even when receiving a file to stdout. This causes a problem since the fetch messages becomming intertwined with the received file. >How-To-Repeat: Fetch a file to stdout and redirect to a file. Tail and head the file and you will see fetch output. >Fix: My solution was to patch fetch/main.c to print to stderr instead of stdout. retrieving revision 1.34 diff -r1.34 main.c 310,311c310,311 < printf ("%s", s); < fflush (stdout); --- > fprintf (stderr, "%s", s); > fflush (stderr); 318c318 < printf ("\r%s: 100%%", s); --- > fprintf (stderr, "\r%s: 100%%", s); 320c320 < printf ("\r%s: %qd Kbytes", s, (quad_t)bytes/1024); --- > fprintf (stderr, "\r%s: %qd Kbytes", s, (quad_t)bytes/1024); 322c322 < printf ("\n%qd bytes transfered in %.1f seconds", (quad_t)bytes, d); --- > fprintf (stderr, "\n%qd bytes transfered in %.1f seconds", (quad_t)byt, d); 325c325 < printf (" (%.0f bytes/s)\n", d); --- > fprintf (stderr, " (%.0f bytes/s)\n", d); 328c328 < printf (" (%.2f kB/s)\n", d); --- > fprintf (stderr, " (%.2f kB/s)\n", d); 341c341 < printf ("\r%s: %2qd%%", s, (quad_t)bytes/(size/100)); --- > fprintf (stderr, "\r%s: %2qd%%", s, (quad_t)bytes/(size/100)); 343c343 < printf ("\r%s: %2qd%%", s, (quad_t)100*bytes/size); --- > fprintf (stderr, "\r%s: %2qd%%", s, (quad_t)100*bytes/size); 345,346c345,346 < printf ("\r%s: %qd kB", s, (quad_t)bytes/1024); < fflush (stdout); --- > fprintf (stderr, "\r%s: %qd kB", s, (quad_t)bytes/1024); > fflush (stderr); >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702150225.SAA21258>