bug-wget
[Top][All Lists]
Advanced

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

Re: --wait interrupted on SIGWINCH; nanosleep not used


From: Tim Rühsen
Subject: Re: --wait interrupted on SIGWINCH; nanosleep not used
Date: Sun, 31 Jan 2021 18:13:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Hi Felix,

On 25.01.21 17:28, Felix Dietrich wrote:
Hello,

I noticed that wget does interrupt its --wait between retrieval of
multiple files when my terminal window gets resized.  Reading through
the sources it seems that the “xsleep” function (in utils.c) only
supports the continuation of interrupted sleeps when the system provides
a nanosleep function, which mine do, and the appropriate code is enabled
when HAVE_NANOSLEEP is defined – but HAVE_NANOSLEEP does not appear to
still get defined anywhere.  Previously, it was AC_DEFINEd by a custom
macro WGET_NANOSLEEP which was removed with [1] when instead Gnulib’s
nanosleep module was added.  The nanosleep module, though, only sets the
shell variable HAVE_NANOSLEEP and AC_SUBST it (via time.h.m4): it does
not define a macro for the C preprocessor.  This means that nanosleep is
not used anymore, anywhere, even on systems that would support it.

 From here I am uncertain how to continue:

   - Has the fallback code to “usleep” and select become obsolete and
     should simply be removed from “xselect” as Gnulib takes care of the
     compatibility?  (In this case the members of “struct timespec
     remaining”, probably, need to be initialised to 0 and checked before
     restarting nanosleep: the Gnulib’s fallback implementation does not
     appear to use or set it when interrupted.)

   - Should HAVE_NANOSLEEP be AC_DEFINEd again?

   - Maybe something else?

So far, hopefully, I have analysed the issue correctly.

Thanks for looking into it !
Option 1 (fallback code is obsolete) seems to be appropriate.

Can you test that e.g. by adding
  #define HAVE_NANOSLEEP 1
to src/config.h and then rebuild with
  make clean && make
?

The mentioned commit [1] should have removed the fallback code and the '#ifdef HAVE_NANOSLEEP'.

If you confirm the feature working again when built with the above instructions, I am going to fix the code appropriately.

Regards, Tim



[1] Commit: a384f5e2e9afd11e363d011b474c2e5da5573103


Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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