Changeset 372 for trunk/src/sh_inotify.c


Ignore:
Timestamp:
Nov 1, 2011, 12:33:37 AM (13 years ago)
Author:
katerina
Message:

One more patch for ticket #265 (inotify). Handle dirs that are only specified as files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_inotify.c

    r371 r372  
    125125{
    126126  int    watch;
    127   int    flag;
     127  short  flag;
     128  short  type;
    128129  int    class;
    129130  unsigned long check_mask;
     
    355356
    356357char * sh_inotify_pop_dormant(sh_watches * watches,
    357                               int * class, unsigned long * check_mask)
     358                              int * class, unsigned long * check_mask, int * type)
    358359{
    359360  char * popret = NULL;
     
    372373    {
    373374      *class = this->watch->class;
     375      *type  = this->watch->type;
    374376      *check_mask = this->watch->check_mask;
    375377      popret = sh_util_strdup(this->watch->file);
     
    472474int sh_inotify_add_watch_later(char * filename, sh_watches * watches,
    473475                               int * errnum,
    474                                int class, unsigned long check_mask)
     476                               int class, unsigned long check_mask, int type)
    475477{
    476478  sh_watch   * item;
     
    479481
    480482  item->class      = class;
     483  item->type       = (short) type;
    481484  item->check_mask = check_mask;
    482485
     
    571574 */
    572575int sh_inotify_add_watch(char * filename, sh_watches * watches, int * errnum,
    573                          int class, unsigned long check_mask)
     576                         int class, unsigned long check_mask, int type)
    574577{
    575578  volatile int retval = 0;
     
    614617
    615618          item->class      = class;
     619          item->type       = type;
    616620          item->check_mask = check_mask;
    617621         
     
    651655
    652656char * sh_inotify_search_item(sh_watches * watches, int watch,
    653                               int * class, unsigned long * check_mask)
     657                              int * class, unsigned long * check_mask, int * type)
    654658{
    655659  sh_watch * item;
     
    668672      *class      = item->class;
    669673      *check_mask = item->check_mask;
     674      *type       = item->type;
    670675      sret = sh_util_strdup(item->file);
    671676    }
     
    705710      if (filename)
    706711        {
    707           if (sh_inotify_add_watch(filename, watches, errnum, 0, 0) < 0)
     712          if (sh_inotify_add_watch(filename, watches, errnum, 0, 0, SH_INOTIFY_FILE) < 0)
    708713            {
    709714              retry_msleep(waitsec, 0);
Note: See TracChangeset for help on using the changeset viewer.