URI: 
       tEffectively use the file given as argument - wendy - watch files/directories and run commands on any event
  HTML git clone git://z3bra.org/wendy
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 55dd5c5c358743bfd8461c135206f6907dbff516
   DIR parent 4347b16b35ccf473b2bc53e11fb96fe79fe8f1d5
  HTML Author: z3bra <willy@mailoo.org>
       Date:   Wed, 12 Feb 2014 09:09:58 +0100
       
       Effectively use the file given as argument
       
       Diffstat:
         M wendy.c                             |       8 ++++----
       
       1 file changed, 4 insertions(+), 4 deletions(-)
       ---
   DIR diff --git a/wendy.c b/wendy.c
       t@@ -98,7 +98,7 @@ main (int argc, char **argv)
            int  fd, wd, len, i = 0, timeout = 0, ignore = 0, quiet = 0;
            uint32_t mask = 0;
            char buf[BUF_LEN];
       -    char *dir = NULL, *file = NULL, **cmd = NULL;
       +    char *file = NULL, **cmd = NULL;
            struct inotify_event *ev;
        
            if ((argc == 2 && argv[1][0] == '-' && argv[1][1] == 'h')) usage();
       t@@ -120,7 +120,7 @@ main (int argc, char **argv)
            }
        
            /* test given arguments */
       -    if (!dir)       { dir = DEFAULT_FILE; }
       +    if (!file)      { file = DEFAULT_FILE; }
            if (!timeout)   { timeout = DEFAULT_CHECK; }
        
            /* get file descriptor */
       t@@ -129,13 +129,13 @@ main (int argc, char **argv)
                perror("inotify_init");
        
            /* add a watcher on the file */
       -    wd  = inotify_add_watch(fd, dir, mask);
       +    wd  = inotify_add_watch(fd, file, mask);
        
            if (wd < 0)
                perror("inotify_add_watch");
        
            if (!quiet) {
       -        printf( "watching directory %s with event mask %u\n", dir, mask);
       +        printf( "watching file %s with event mask %u\n", file, mask);
            }
        
            /* start looping */