To prevent warnings from tools like Valgrind, or handle issues
with RAM leaks on non-MMU systems like uClinux, we must free
the memory allocated by pidfile().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch makes it possible to override the default pidfile() path used
for PID files, _PATH_VARRUN, with a custom path, e.g. _PATH_TMP.
This change does not affect the ABI of pidfile()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Due to problems with the unit tests the use of utimensat() in pidfile()
was disabled, and forgotten. This patch enables it, but beware, this
thing is QUICK on any system with a L2 cache or better.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch update the `-lite` patch to OpenBSD `pidfile()` by changing
the update atime+mtime patch from writing the PID again to instead use
utimensat(). Less overhead and nanosecond resolution.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Do not assume that asprintf() clears the pointer on failure, which
is non-portable. Also add missing asprintf() return value checks.
Signed-off-by: millert@
Signed-off-by: deraadt@ guenther@ doug@
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>