aboutsummaryrefslogtreecommitdiff
path: root/miscutils/inotifyd.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-23 11:13:23 +0000
committerRon Yorston <rmy@pobox.com>2012-03-23 11:13:23 +0000
commit40514a0309939f2446f0d4ed9600cad5de396e7f (patch)
tree0f5f4a57d4bb7893418b5bb11d482858eb17ba8b /miscutils/inotifyd.c
parent9db164d6e39050d09f38288c6045cd2a2cbf6d63 (diff)
parentc0cae52662ccced9df19f19ec94238d1b1e3bd71 (diff)
downloadbusybox-w32-40514a0309939f2446f0d4ed9600cad5de396e7f.tar.gz
busybox-w32-40514a0309939f2446f0d4ed9600cad5de396e7f.tar.bz2
busybox-w32-40514a0309939f2446f0d4ed9600cad5de396e7f.zip
Merge commit 'c0cae52662ccced9df19f19ec94238d1b1e3bd71' into merge
Conflicts: Makefile.flags scripts/basic/fixdep.c
Diffstat (limited to 'miscutils/inotifyd.c')
-rw-r--r--miscutils/inotifyd.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/miscutils/inotifyd.c b/miscutils/inotifyd.c
index b64e0abb9..7a1a6a2e5 100644
--- a/miscutils/inotifyd.c
+++ b/miscutils/inotifyd.c
@@ -33,6 +33,7 @@
33//usage: "Run PROG on filesystem changes." 33//usage: "Run PROG on filesystem changes."
34//usage: "\nWhen a filesystem event matching MASK occurs on FILEn," 34//usage: "\nWhen a filesystem event matching MASK occurs on FILEn,"
35//usage: "\nPROG ACTUAL_EVENTS FILEn [SUBFILE] is run." 35//usage: "\nPROG ACTUAL_EVENTS FILEn [SUBFILE] is run."
36//usage: "\nIf PROG is -, events are sent to stdout."
36//usage: "\nEvents:" 37//usage: "\nEvents:"
37//usage: "\n a File is accessed" 38//usage: "\n a File is accessed"
38//usage: "\n c File is modified" 39//usage: "\n c File is modified"
@@ -177,12 +178,20 @@ int inotifyd_main(int argc, char **argv)
177 *s++ = mask_names[i]; 178 *s++ = mask_names[i];
178 } 179 }
179 *s = '\0'; 180 *s = '\0';
180// bb_error_msg("exec %s %08X\t%s\t%s\t%s", args[0], 181 if (LONE_CHAR(args[0], '-')) {
181// ie->mask, events, watches[ie->wd], ie->len ? ie->name : ""); 182 /* "inotifyd - FILE": built-in echo */
182 args[1] = events; 183 printf(ie->len ? "%s\t%s\t%s\n" : "%s\t%s\n", events,
183 args[2] = watches[ie->wd]; 184 watches[ie->wd],
184 args[3] = ie->len ? ie->name : NULL; 185 ie->name);
185 spawn_and_wait((char **)args); 186 fflush(stdout);
187 } else {
188// bb_error_msg("exec %s %08X\t%s\t%s\t%s", args[0],
189// ie->mask, events, watches[ie->wd], ie->len ? ie->name : "");
190 args[1] = events;
191 args[2] = watches[ie->wd];
192 args[3] = ie->len ? ie->name : NULL;
193 spawn_and_wait((char **)args);
194 }
186 // we are done if all files got final x event 195 // we are done if all files got final x event
187 if (ie->mask & 0x8000) { 196 if (ie->mask & 0x8000) {
188 if (--argc <= 0) 197 if (--argc <= 0)