[hackers] [sinit] Prefix signal handlers with 'sig' || sin

From: <git_AT_suckless.org>
Date: Wed, 18 Feb 2015 18:56:25 +0100 (CET)

commit 15a22edf7c1f2e5b7ac0863f6e20b474a14d9de8
Author: sin <sin_AT_2f30.org>
Date: Wed Feb 18 17:55:27 2015 +0000

    Prefix signal handlers with 'sig'
    
    Apparently reboot() is an existing symbol on some BSD systems.

diff --git a/sinit.c b/sinit.c
index eb834f6..e338f35 100644
--- a/sinit.c
+++ b/sinit.c
_AT_@ -9,18 +9,18 @@
 
 #define LEN(x) (sizeof (x) / sizeof *(x))
 
-static void poweroff(void);
-static void reap(void);
-static void reboot(void);
+static void sigpoweroff(void);
+static void sigreap(void);
+static void sigreboot(void);
 static void spawn(char *const []);
 
 static struct {
         int sig;
         void (*handler)(void);
 } sigmap[] = {
- { SIGUSR1, poweroff },
- { SIGCHLD, reap },
- { SIGINT, reboot },
+ { SIGUSR1, sigpoweroff },
+ { SIGCHLD, sigreap },
+ { SIGINT, sigreboot },
 };
 
 #include "config.h"
_AT_@ -53,20 +53,20 @@ main(void)
 }
 
 static void
-poweroff(void)
+sigpoweroff(void)
 {
         spawn(rcpoweroffcmd);
 }
 
 static void
-reap(void)
+sigreap(void)
 {
         while (waitpid(-1, NULL, WNOHANG) > 0)
                 ;
 }
 
 static void
-reboot(void)
+sigreboot(void)
 {
         spawn(rcrebootcmd);
 }
Received on Wed Feb 18 2015 - 18:56:25 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 18 2015 - 19:00:15 CET