Slight cleanup of public API in helpers.c

Function renames:
  - set_procname() --> procname_set()
  - kill_procname() --> procname_kill()
  - get_pidname() --> pid_get_name()

Also added three new helper functions, for external plugins:
  - pid_alive()
  - pidfile_poll()
  - pidfile_read()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2012-09-27 20:56:46 +02:00
1 parent 0d70fa4cf0
commit ff73dab447
4 files changed
+253 -139

No files matched your search

+3 -3
View File
@@ -87,7 +87,7 @@ void do_shutdown (int sig)
static void shutdown_handler(int sig, siginfo_t *info, void *UNUSED(ctx))
{
_d("Rebooting on signal %d from %s (PID %d)",
sig, get_pidname(info->si_pid, NULL, 0), info->si_pid);
sig, pid_get_name(info->si_pid, NULL, 0), info->si_pid);
do_shutdown(sig);
}
@@ -106,14 +106,14 @@ static void chld_handler(int UNUSED(sig), siginfo_t *UNUSED(info), void *UNUSED(
static void sigstop_handler(int sig, siginfo_t *info, void *UNUSED(ctx))
{
_d("Received SIGSTOP(%d) from %s (PID %d)",
sig, get_pidname(info->si_pid, NULL, 0), info->si_pid);
sig, pid_get_name(info->si_pid, NULL, 0), info->si_pid);
touch(SYNC_STOPPED);
stopped ++;
}
static void sigcont_handler(int sig, siginfo_t *info, void *UNUSED(ctx))
{
_d("Received SIGCONT(%d) from %s (PID %d)",
sig, get_pidname(info->si_pid, NULL, 0), info->si_pid);
sig, pid_get_name(info->si_pid, NULL, 0), info->si_pid);
stopped = 0;
remove(SYNC_STOPPED);
}