Lines 1-20
Link Here
|
1 |
--- src/handlers.c.orig Mon Feb 23 01:42:46 2004 |
1 |
--- src/handlers.c.orig Mon Feb 23 02:42:46 2004 |
2 |
+++ src/handlers.c Sun May 23 17:50:35 2004 |
2 |
+++ src/handlers.c Fri Jun 11 16:25:12 2004 |
3 |
@@ -7,6 +7,10 @@ |
3 |
@@ -7,6 +7,11 @@ |
4 |
#include "node.h" |
4 |
#include "node.h" |
5 |
#include "opts.h" |
5 |
#include "opts.h" |
6 |
#include "wl.h" |
6 |
#include "wl.h" |
7 |
+#if defined(__FreeBSD__) |
7 |
+#if defined(__FreeBSD__) |
|
|
8 |
+#include <signal.h> |
8 |
+#include "libgen.h" |
9 |
+#include "libgen.h" |
9 |
+#endif |
10 |
+#endif |
10 |
+ |
11 |
+ |
11 |
extern struct arguments_t arguments; |
12 |
extern struct arguments_t arguments; |
12 |
struct handler_t handlers[FC_HANDLER_MAX]= |
13 |
struct handler_t handlers[FC_HANDLER_MAX]= |
13 |
{ |
14 |
{ |
14 |
@@ -180,12 +184,18 @@ |
15 |
@@ -180,12 +185,24 @@ |
15 |
} |
16 |
} |
16 |
void show_event(enum handler_enum_t id, char *filename) |
17 |
void show_event(enum handler_enum_t id, char *filename) |
17 |
{ |
18 |
{ |
|
|
19 |
+ struct sigaction sa; |
20 |
+ |
18 |
+ if (arguments.fileschanged.exec_command == NULL) { |
21 |
+ if (arguments.fileschanged.exec_command == NULL) { |
19 |
if (arguments.fileschanged.showaction) |
22 |
if (arguments.fileschanged.showaction) |
20 |
{ |
23 |
{ |
Lines 23-28
Link Here
|
23 |
fprintf(stdout, "%s\n",filename); |
26 |
fprintf(stdout, "%s\n",filename); |
24 |
fflush(stdout); |
27 |
fflush(stdout); |
25 |
+ } else { |
28 |
+ } else { |
|
|
29 |
+ sa.sa_handler = SIG_IGN; |
30 |
+ sa.sa_flags = SA_NOCLDWAIT; |
31 |
+ sigemptyset(&sa.sa_mask); |
32 |
+ sigaction(SIGCHLD, &sa, NULL); |
26 |
+ if (!fork()) { |
33 |
+ if (!fork()) { |
27 |
+ execlp(arguments.fileschanged.exec_command, |
34 |
+ execlp(arguments.fileschanged.exec_command, |
28 |
+ } |
35 |
+ } |