Re: Use who = 0 instead getpid(2) in setprioriy(2) call in watchdog(8)

2016-09-17 Thread Rafael Neves
On Sat, Sep 17, 2016 at 02:36:49PM +0100, Rafael Neves wrote:
> Hi,
> 
> The patch bellow replaces in watchdog(8), the setpriority(2) + getpid(2) 
> idiom with a single
> setpriority(2) with who = 0.
>
[snip]

Sorry, the patch in the original e-mail does not apply, here follows the 
corrected one. 


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 -  1.15
+++ usr.sbin/watchdogd/watchdogd.c  17 Sep 2016 16:16:20 -
@@ -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);
 



Use who = 0 instead getpid(2) in setprioriy(2) call in watchdog(8)

2016-09-17 Thread Rafael Neves
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 -  1.15
+++ usr.sbin/watchdogd/watchdogd.c  7 Sep 2016 21:55:36 -
@@ -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);