bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [PATCH v2] bug #45790: wget prints it's progress even whe


From: address@hidden
Subject: Re: [Bug-wget] [PATCH v2] bug #45790: wget prints it's progress even when background
Date: Sun, 2 Oct 2016 21:54:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Is there a instruction on how to compile current wget version on windows?

Piotr

W dniu 30.09.2016 o 10:53, Eli Zaretskii pisze:
From: Piotr Wajda <address@hidden>
Date: Fri, 30 Sep 2016 09:51:37 +0200

Hi, Reworked recent patch to behave correctly on fg and bg. Now user can switch 
from fg to bg and vice versa and wget will select fd accordingly.
Thanks.

+  /* Initialize this values so we don't have to ask every time we print line */
+  shell_is_interactive = isatty (STDIN_FILENO);
The MS-Windows version of isatty returns non-zero when its argument
file descriptor is open on any character device.  Notably, this
includes the null device, which is definitely not what we want in this
case, I think.

So I think using this logic will need to import isatty from Gnulib, or
provide an alternative implementation in mswindows.c.

  static void
  check_redirect_output (void)
  {
-  if (redirect_request == RR_REQUESTED)
+  /* If it was redirected already to log file by SIGHUP or SIGUSR1, it was 
permanent */
+  if(!redirect_request_signal_name && shell_is_interactive)
      {
-      redirect_request = RR_DONE;
-      redirect_output ();
+      if(tcgetpgrp(STDIN_FILENO) != getpgrp())
Neither tcgetpgrp nor getpgrp exist on MS-Windows.

AFAIU, this test is intended to check whether wget was backgrounded.
Since AFAIK that's not possible on MS-Windows, this test should always
return zero on Windows, so I suggest a separate predicate function
with 2 implementations: one on Windows, the other on Posix platforms.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]