summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2003-10-20 21:53:46 +0000
committerLennart Poettering <lennart@poettering.net>2003-10-20 21:53:46 +0000
commitce36dd0994ffa833ff0ce18e57a8776ff1103d8d (patch)
treeb0685edee04c84b0fd1a2593c1afffaa18da0448 /examples
parentdf2e940cfd540ea46dd95da77ebacc35ae58423e (diff)
commit release 0.3
git-svn-id: file:///home/lennart/svn/public/libdaemon/trunk@41 153bfa13-eec0-0310-be40-b0cb6a0e1b4b
Diffstat (limited to 'examples')
-rw-r--r--examples/testd.c7
1 files changed, 7 insertions, 0 deletions
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 */