Commit Graph
12 Commits
Author SHA1 Message Date
Joachim Nilsson 883c90112d Update modification date
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-04 12:46:44 +02:00
Joachim Nilsson a2c8dddaad Free pidfile_path atexit()
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>
2016-07-04 12:42:22 +02:00
Joachim Nilsson 50cb72018f pidfile: Portability fix, utimensat() in sys/time.h
For building libite on NetBSD, and probably other BSD's as well.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-06-08 06:25:02 +02:00
Joachim Nilsson dedcaf92d5 Minor style fix, to keep with pidfile.c style
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-06-06 12:16:14 +02:00
Joachim Nilsson c009c49a92 Expose __pidfile_path to override _PATH_VARRUN
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>
2016-06-06 12:14:26 +02:00
Joachim Nilsson 9b6ef1f053 pidfile(): Activate use of utimensat() to update atime+mtime
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>
2016-04-11 01:18:57 +02:00
Joachim Nilsson 979f76aea7 pidfile(): Use utimensat() to update atime+mtime
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>
2016-03-20 02:14:30 +01:00
Joachim Nilsson 253460b4b8 Make pidfile() name accessible (read-only) to daemon as __pidfile_name
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-01-21 23:28:59 +01:00
Joachim Nilsson c14c6a1e62 pidfile.c: Add LITE #ifdef pidfile and comment LITE mtime extension
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-01-07 02:58:06 +01:00
Joachim Nilsson 148027674a pidfile: Only update mtime i called multiple times
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-12-16 18:40:34 +01:00
Joachim Nilsson a4cbc7a10e pidfile.c: Upgrade to OpenBSD r1.11, asprintf() fixes.
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>
2015-07-22 11:53:44 +02:00
Joachim Nilsson 9ed00baa94 Add pidfile() from NetBSD/OpenBSD, missing in GLIBC.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-09 01:25:19 +02:00