[gccsdk] wget 1.19.1 tries to write a logfile

David Pitt pittdj at pittdj.co.uk
Thu Aug 31 03:39:26 PDT 2017


Ralph Corderoy, on 30 Aug, wrote:

> Hi Theo,
> 
> > It is still worth commenting on upstream bug trackers - they won't
> > know what RISC OS is, but if the bug is not a RISC OS specific one
> > then the bug report is still relevant.
> 
> It might be that RISC OS triggers it in a similar way to the odd set up
> on that bug report.
> 
>     src/log.c:
>     955 static void
>     956 check_redirect_output (void)
>     957 {
>     958 #ifndef WINDOWS
>     959   /* If it was redirected already to log file by SIGHUP, SIGUSR1
or -o parameter,
>     960    * it was permanent.
>     961    * If there was no SIGHUP or SIGUSR1 and shell is interactive
>     962    * we check if process is fg or bg before every line is
printed.*/
>     963   if (!redirect_request_signal_name && shell_is_interactive &&
!opt.lfilename)
>     964     {
>  →  965       if (tcgetpgrp (STDIN_FILENO) != getpgrp ())
>     966         {
>     967           /* Process backgrounded */
>   → 968           redirect_output (true,NULL);
>     969         }
> 
> I haven't run this code, but I wonder if 965 is true.  If Kevin is happy
> to modify the source and re-build then he might be able to tell that 968
> executes.

Perhaps this :-

https://fossies.org/diffs/wget/1.18_vs_1.19/ChangeLog-diff.html

2016-10-21  losgrandes  <pwajda at gmail.net.pl>
 	
Fixes #45790: wget prints it's progress even when background
 * src/log.c: Use tcgetpgrp(STDIN_FILENO) != getpgrp() to determine when
to print to STD* or logfile.
 Deprecate log_request_redirect_output function.
 Use different file handles for STD* and logfile, to easily switch betwe en
them when changing fg/bg.
 * src/log.h: Make redirect_output function externally linked.
 * src/main.c: Don't use deprecated log_request_redirect_output function. 
 Use redirect_output instead.
 * src/mswindows.c: Don't use deprecated log_request_redirect_output 
function. Use redirect_output instead.
-- 
David Pitt



More information about the gcc mailing list