[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--wait interrupted on SIGWINCH; nanosleep not used
From: |
Felix Dietrich |
Subject: |
--wait interrupted on SIGWINCH; nanosleep not used |
Date: |
Mon, 25 Jan 2021 17:28:24 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
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.
[1] Commit: a384f5e2e9afd11e363d011b474c2e5da5573103
--
Felix Dietrich
- --wait interrupted on SIGWINCH; nanosleep not used,
Felix Dietrich <=