chiark / gitweb /
sd-daemon,man: ignore missing $WATCHDOG_PID
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 Oct 2014 22:44:09 +0000 (18:44 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 23 Oct 2014 04:17:18 +0000 (00:17 -0400)
commita9becdd65bb4b64675bc0c109d14ab12b1ecd2b7
tree45faa8c9e120afe1e8227926bc238d5e0eeb2920
parent203af57fcdced5debfc26e1083eaefa031e322f4
sd-daemon,man: ignore missing $WATCHDOG_PID

Systemd 209 started setting $WATCHDOG_PID, and sd-daemon watch was
modified to check for this variable. This means that
sd_watchdog_enabled() stopped working with previous versions of
systemd. But sd-event is a public library and API and we must keep it
working even when a program compiled with a newer version of the
libary is used on a system running an older version of the manager.

getenv() and unsetenv() are fairly expensive calls, so optimize
sd_watchdog_enabled() by not calling them when unnecessary.

man: centralize the description of $WATCHDOG_PID and $WATCHDOG_USEC in
the sd_watchdog_enabled manpage. It is better not to repeat the same
stuff in two places.
man/sd_notify.xml
man/sd_watchdog_enabled.xml
src/libsystemd/sd-daemon/sd-daemon.c