You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
354 B
23 lines
354 B
![]()
16 years ago
|
#include "cache.h"
|
||
![]()
11 years ago
|
#include "sigchain.h"
|
||
![]()
16 years ago
|
|
||
|
#define X(f) \
|
||
|
static void f(int sig) { \
|
||
|
puts(#f); \
|
||
|
fflush(stdout); \
|
||
|
sigchain_pop(sig); \
|
||
|
raise(sig); \
|
||
|
}
|
||
|
X(one)
|
||
|
X(two)
|
||
|
X(three)
|
||
|
#undef X
|
||
|
|
||
![]()
9 years ago
|
int cmd_main(int argc, const char **argv) {
|
||
![]()
16 years ago
|
sigchain_push(SIGTERM, one);
|
||
|
sigchain_push(SIGTERM, two);
|
||
|
sigchain_push(SIGTERM, three);
|
||
|
raise(SIGTERM);
|
||
![]()
16 years ago
|
return 0;
|
||
|
}
|