]>
Commit | Line | Data |
---|---|---|
9385eb3d A |
1 | --- signal.c.orig Thu Jan 31 16:57:29 2002 |
2 | +++ signal.c Fri May 16 14:16:12 2003 | |
3 | @@ -47,10 +47,13 @@ | |
4 | ||
5 | sigset_t _sigintr; /* shared with siginterrupt */ | |
6 | ||
7 | -sig_t | |
8 | -signal(s, a) | |
9 | +extern int _sigaction_nobind (int sig, const struct sigaction *nsv, struct sigaction *osv); | |
10 | + | |
11 | +static sig_t | |
12 | +signal__(s, a, bind) | |
13 | int s; | |
14 | sig_t a; | |
15 | + int bind; | |
16 | { | |
17 | struct sigaction sa, osa; | |
18 | ||
19 | @@ -59,7 +62,34 @@ | |
20 | sa.sa_flags = 0; | |
21 | if (!sigismember(&_sigintr, s)) | |
22 | sa.sa_flags |= SA_RESTART; | |
23 | +#if defined(__DYNAMIC__) | |
24 | + if (bind) { | |
25 | +#endif /* __DYNAMIC__ */ | |
26 | if (_sigaction(s, &sa, &osa) < 0) | |
27 | return (SIG_ERR); | |
28 | +#if defined(__DYNAMIC__) | |
29 | + } else { | |
30 | + if (_sigaction_nobind(s, &sa, &osa) < 0) | |
31 | + return (SIG_ERR); | |
32 | + } | |
33 | +#endif /* __DYNAMIC__ */ | |
34 | return (osa.sa_handler); | |
35 | } | |
36 | + | |
37 | +sig_t | |
38 | +signal(s, a) | |
39 | + int s; | |
40 | + sig_t a; | |
41 | +{ | |
42 | + return signal__(s, a, 1); | |
43 | +} | |
44 | + | |
45 | +#if defined(__DYNAMIC__) | |
46 | +sig_t | |
47 | +_signal_nobind(s, a) | |
48 | + int s; | |
49 | + sig_t a; | |
50 | +{ | |
51 | + return signal__(s, a, 0); | |
52 | +} | |
53 | +#endif /* __DYNAMIC__ */ |