Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/miscutils/inotifyd.c

    r2725 r3232  
    2727 * See below for mask names explanation.
    2828 */
     29
     30//usage:#define inotifyd_trivial_usage
     31//usage:    "PROG FILE1[:MASK]..."
     32//usage:#define inotifyd_full_usage "\n\n"
     33//usage:       "Run PROG on filesystem changes."
     34//usage:     "\nWhen a filesystem event matching MASK occurs on FILEn,"
     35//usage:     "\nPROG ACTUAL_EVENTS FILEn [SUBFILE] is run."
     36//usage:     "\nIf PROG is -, events are sent to stdout."
     37//usage:     "\nEvents:"
     38//usage:     "\n    a   File is accessed"
     39//usage:     "\n    c   File is modified"
     40//usage:     "\n    e   Metadata changed"
     41//usage:     "\n    w   Writable file is closed"
     42//usage:     "\n    0   Unwritable file is closed"
     43//usage:     "\n    r   File is opened"
     44//usage:     "\n    D   File is deleted"
     45//usage:     "\n    M   File is moved"
     46//usage:     "\n    u   Backing fs is unmounted"
     47//usage:     "\n    o   Event queue overflowed"
     48//usage:     "\n    x   File can't be watched anymore"
     49//usage:     "\nIf watching a directory:"
     50//usage:     "\n    m   Subfile is moved into dir"
     51//usage:     "\n    y   Subfile is moved out of dir"
     52//usage:     "\n    n   Subfile is created"
     53//usage:     "\n    d   Subfile is deleted"
     54//usage:     "\n"
     55//usage:     "\ninotifyd waits for PROG to exit."
     56//usage:     "\nWhen x event happens for all FILEs, inotifyd exits."
    2957
    3058#include "libbb.h"
     
    151179                }
    152180                *s = '\0';
    153 //              bb_error_msg("exec %s %08X\t%s\t%s\t%s", args[0],
    154 //                  ie->mask, events, watches[ie->wd], ie->len ? ie->name : "");
    155                 args[1] = events;
    156                 args[2] = watches[ie->wd];
    157                 args[3] = ie->len ? ie->name : NULL;
    158                 spawn_and_wait((char **)args);
     181                if (LONE_CHAR(args[0], '-')) {
     182                    /* "inotifyd - FILE": built-in echo */
     183                    printf(ie->len ? "%s\t%s\t%s\n" : "%s\t%s\n", events,
     184                            watches[ie->wd],
     185                            ie->name);
     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                }
    159195                // we are done if all files got final x event
    160196                if (ie->mask & 0x8000) {
Note: See TracChangeset for help on using the changeset viewer.