6 Commits
Author SHA1 Message Date
Joachim Nilsson 44e787c966 Add generic support for running tests as root.
By setting `ASROOT=1` in a unit test makefile a test will now run as
root, using `sudo -n`.

This patch allows us to simplify the pidfilefn() test.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-23 01:30:29 +02:00
Joachim Nilsson ab2b0f00fa Add autotest for pidfilefn et al.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 22:41:34 +02:00
Joachim Nilsson 8db314623a Followup to pidfilefn.c, add system include file for usleep()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-09 03:22:53 +02:00
Joachim Nilsson e731d83881 Add pidfile_poll() from Finit, waits max 5 sec for pidfile.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-09 03:19:56 +02:00
Joachim Nilsson c2d0ed0d12 Fix minor issues in pidfile_read() and pidfile_signal(), caught by Coverity
- Simplify pidfile_read(), no need to call access() when fopen() is more
  than capable of failing on its own if we do not have READ access.
- The remove() syscall requires that you check the return value, but we
  don't care about that when having signalled a TERM signal to a process.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-09 01:59:10 +02:00
Joachim Nilsson 5a50a6add1 Add client side pidfile functions: pidfile_read(), pidfile_signal().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-09 01:36:58 +02:00