This fixes all the calls to die so they pass a proper string and not
NULL. die blindly pass its arguments to log_fatal, which in turns
relays on vprintf or such. At least on OpenBSD, giving NULL instead
of a string for %s yields a log entry in syslog:
Jan 21 09:35:22 venera gophernicus: vfprintf %s NULL in "Error: %s %s\^M "
As a side effect, now some errors from pledge and unveil are slightly
more clear.
`getcwd(3)' returns a NULL pointer when it fails, and a pointer to the buffer
when it succeeds. The array of characters (allocated on the stack) is not NULL,
so it cannot be used to check if `getcwd(3)' succeeded. Use the pointer
returned by `getcwd(3)' to check success.
DESTDIR when used in packaging can represent a temporary directory or fake root used for packaging the application, so using this value for modifying the listener config is not ideal, as the binary path will be incorrect.
This build system is very different to the old build system, and is much
more inuitive.
It leverages a hand made configure script to generate the Makefile. The
listener is no longer auto-detected, unless specifically specified, and
no longer activated by default. That is not the place for a build system.
Along with the focus of moving to distribution repositiories, this 'feature'
is clearly unwanted by distributions.
Multiple listeners are now also supported, primarily for distributions.
Lastly, parallelism now works as well.
This make it easier to manage separate compilation units (static functions and
global variables, local type definitions, etc.)
The generated header file `functions.h' caused a circular dependency problem;
it wasn't updated automatically when changes were made to the sources (e.g.
new function definition). The sources can't be in the dependency list of
`functions.h' in the Makefile, because `functions.h' is in the dependency list
of each source file. GNU make is able to ignore the circular dependency but not
BSD make.
At any rate, keeping the prototype list up-to-date is easy, because the
compiler will complain if a function is used in a compilation unit but defined
in an other one.
It also makes static analysis easier out of the box.
When a gopherer comes in contact with a user listing, the current
order is pretty much useless (by UID). It makes much more sense
to sort by the date modified.
Closes#62
* Renamed gophernicus.1.man to gophernicus.1, the standard name for section 1
manual pages.
* Added synopsis of command.
* Added markup for options, arguments, paths, authors, links.