Although defining _DEFAULT_SOURCE is overkill for nanosleep, it also fixes
"field ‘b’ has incomplete type" errors, as we need __USE_MISC defined to
pick up the definition of ifreq in <net/if.h>.
In particular,
- Drop unnecessary definition of DESTDIR.
- Drop LIBDIR; pointed to deprecated X11R6 directory.
- Honors CPPFLAGS and LDFLAGS build flags.
- Remove out-of-date version number from installation message.
Based in part on a patch from the Debian package [1].
[1] https://sources.debian.net/src/wmifs/1.4-2/debian/patches/hardening.patch/
In particular,
- Remove note about version 1.0 (was never released).
- Remove note about LED colors (implemented).
- Remove note about language files (unnecessary with locale support).
- Update email address.
Since we now reread the configuration files on occasion, the options given
at the command line could be overwritten. To avoid this, we save the
command line options and always use them if present.
We add command line options for the user to change the start, stop, speed,
ifdown, and stampfile settings at runtime. This closes a Debian wishlist
bug [1].
Note that, in order to have the command line options overwrite the
defaults set in the configuration file, we split the command line parsing
code into a new function (parse_cmdline()). We then merged main() and
wmppp_routine().
We document the new options in the help text and in the man page. We also
take the opportunity to reformat the help text for the -i option and add
the -geometry option to the man page.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293839
Main change is to use $(INSTALL) instead of cp in install target along with
$(DESTDIR) variable. We also remove installation of user ~/.wmppprc config
file -- this isn't useful for sysadmins or package maintainers.
We also update INSTALL to reflect the changes.
We actually include <sys/socket.h> instead of <bits/socket_type.h>, as it
returns an error: "Never include <bits/socket_type.h> directly; use
<sys/socket.h> instead."
Fixes "warning: null argument where non-null required" compiler warnings by
not passing NULL to strdup and "(warning) Conversion of string literal to
bool always evaluates to true" found by cppcheck.
This fixes "(portability) scanf without field width limits can crash with
huge input data on some versions of libc" warning from cppcheck.
We choose 10 as the field width limit as it is the number of characters in
2^31-1, the largest int.
Note that this was a fork of the earlier 1998-05-02 version and didn't
contain the later changes. Therefore we merge the best of both versions.
wmtime had some additional unnecessary dummy variables, so we use the wmmon
version.