Skip to content

Commit 82d4680

Browse files
committed
sig: use const for sig_* constants and add sig_kill.
1 parent 727b2a5 commit 82d4680

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

src/sig.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
#include <signal.h>
44
#include "sig.h"
55

6-
int sig_alarm = SIGALRM;
7-
int sig_child = SIGCHLD;
8-
int sig_cont = SIGCONT;
9-
int sig_hangup = SIGHUP;
10-
int sig_int = SIGINT;
11-
int sig_pipe = SIGPIPE;
12-
int sig_term = SIGTERM;
6+
const int sig_alarm = SIGALRM;
7+
const int sig_child = SIGCHLD;
8+
const int sig_cont = SIGCONT;
9+
const int sig_hangup = SIGHUP;
10+
const int sig_int = SIGINT;
11+
const int sig_kill = SIGKILL;
12+
const int sig_pipe = SIGPIPE;
13+
const int sig_term = SIGTERM;
1314

1415
void (*sig_defaulthandler)() = SIG_DFL;
1516
void (*sig_ignorehandler)() = SIG_IGN;

src/sig.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
#ifndef SIG_H
44
#define SIG_H
55

6-
extern int sig_alarm;
7-
extern int sig_child;
8-
extern int sig_cont;
9-
extern int sig_hangup;
10-
extern int sig_int;
11-
extern int sig_pipe;
12-
extern int sig_term;
6+
extern const int sig_alarm;
7+
extern const int sig_child;
8+
extern const int sig_cont;
9+
extern const int sig_hangup;
10+
extern const int sig_int;
11+
extern const int sig_kill;
12+
extern const int sig_pipe;
13+
extern const int sig_term;
1314

1415
extern void (*sig_defaulthandler)();
1516
extern void (*sig_ignorehandler)();

0 commit comments

Comments
 (0)