Hi,
The patch bellow replaces in watchdog(8), the setpriority(2) + getpid(2) idiom
with a single
setpriority(2) with who = 0.
Index: usr.sbin/watchdogd/watchdogd.c
===================================================================
RCS file: /cvs/src/usr.sbin/watchdogd/watchdogd.c,v
retrieving revision 1.15
diff -u -p -r1.15 watchdogd.c
--- usr.sbin/watchdogd/watchdogd.c 16 Jan 2015 06:40:22 -0000 1.15
+++ usr.sbin/watchdogd/watchdogd.c 7 Sep 2016 21:55:36 -0000
@@ -152,7 +152,7 @@ main(int argc, char *argv[])
(void)setrlimit(RLIMIT_STACK, &rlim);
(void)mlockall(MCL_CURRENT | MCL_FUTURE);
- setpriority(PRIO_PROCESS, getpid(), -5);
+ setpriority(PRIO_PROCESS, 0, -5);
signal(SIGTERM, sighdlr);