Avoid waking up every 500ms in standalone mode to reap any terminated
child processes if pidfds are available. This benefits Linux users with
kernel version 5.3 and glibc 2.36 or later.
Introduces a linked list of fds combining listening sockets and pidfds
and creates a poll set from this list as required.
Child process tracking is now generalised so that the Avahi service is
handled in the same way as client connection processes.
The loop to close and remove the child process descriptors erroneously
expected a live next pointer before handling a node in the list,
resulting in the last node never being processed.
These signals were only being caught when daemonised but should also be
handled with the non-daemonised standalone server otherwise child
processes like the Avahi service can remain after the main process
is terminated.
My intended use case is the following:
I want to compile saned backends with different libraries (for example
glibc) than a specific application (as if it were a chroot of another
distro version). This application cannot dlopen sane
backends because of the library mismatch.
The specific application will be
built with a stripped down libsane that only has the net backend,
and therefore very few dependencies. The net backend points to saned.
saned has a full config and set of backends, and is responsible for
exporting all scanners to the application. This option allows to
reexport network scanners this way. I only have to make sure saned does
not contact itself.
Two changes were made recently for the batch processing component
in scanimage. It's not too bad, just a couple of unused local vars.
Conflict was between some refactoring that I did and a change to
the processing for --batch-prompt.
We have been specially including libgen.h to get a version in other
platforms such as macOS and FreeBSD. However, it is dangerous to
make assumptions about which version of basename that we will get.
So this change reverts to asking for the version that modifies the
argument and creates a copy of the arg that we *can* modify.
HPAIO backend in some instances provides options that have NULL name.
It might be that it is using SETTABLE flag to disable options rather
than removing them from the options list. Or it might just be a
backend bug.
- reduce scope of some variables
- move full_optstring to global so that scanimage_exit can clean it up
- initialize global variables. Global statics are not initialized.
- some other more minor things
The saned(8) man page should be used to describe the behavior of saned
itself. The information about configuring inetd, xinetd, or systemd to
launch saned - while it is helpful - belongs in a separate location.
Keep in mind that distribution packages usually configure the service
automatically, and they may ship with their own specific instructions.
(For example, update-inetd can be used in Debian and its derivatives.)
This change moves this information from the man page into a new file,
making it more concise as well. Working examples are moved to separate
files that can be copied directly from the source tree to the system.
These were intended to suppress GCC warnings about unused variables.
However, this leads to different warnings from Clang instead.
Use another approach that suppresses warnings from both compilers.
With the exception of use in three quotes as well as our inlcuded copy
of the GPL, all use of the Free Software Foundation's postal address
has been removed.
Re #320.
We have seen this from buggy backends that present NULL for constraint
string_lists. This is probably illegal behaviour from backends but we
don't want to crash.
h5400 now checks validity of -l, -t, -x and -y and auto selects a supported resolution.
scanimage now shows the full range for -x and -y despite other selections.
This creates temporary strings that correspond to the colon-delimited
username and password that are read from file in `auth_callback()`.
The null-terminated strings are used directly to determine lengths.