From ce36dd0994ffa833ff0ce18e57a8776ff1103d8d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 20 Oct 2003 21:53:46 +0000 Subject: commit release 0.3 git-svn-id: file:///home/lennart/svn/public/libdaemon/trunk@41 153bfa13-eec0-0310-be40-b0cb6a0e1b4b --- examples/testd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'examples') diff --git a/examples/testd.c b/examples/testd.c index 12b2940..ec5f690 100644 --- a/examples/testd.c +++ b/examples/testd.c @@ -38,7 +38,13 @@ int main(int argc, char *argv[]) { int ret; /* Kill daemon with SIGINT */ + + /* Check if the new function daemon_pid_file_kill_wait() is available, if it is, use it. */ +#ifdef DAEMON_PID_FILE_KILL_WAIT_AVAILABLE + if ((ret = daemon_pid_file_kill_wait(SIGINT, 5)) < 0) +#else if ((ret = daemon_pid_file_kill(SIGINT)) < 0) +#endif daemon_log(LOG_WARNING, "Failed to kill daemon"); return ret < 0 ? 1 : 0; @@ -70,6 +76,7 @@ int main(int argc, char *argv[]) { return 255; } + daemon_log(ret != 0 ? LOG_ERR : LOG_INFO, "Daemon returned %i as return value.", ret); return ret; } else { /* The daemon */ -- cgit