Changeset 458 for trunk/src/sh_hash.c


Ignore:
Timestamp:
Aug 5, 2014, 12:26:42 PM (10 years ago)
Author:
katerina
Message:

Fix for ticket #358 (repetitive lstat warning) and #359 (reporting of added/deleted top level directories).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_hash.c

    r457 r458  
    477477  SH_MUTEX_UNLOCK(mutex_hash);
    478478
     479  /* remove here to avoid second message from hash_unvisited */
     480  if (retval == 0)
     481    sh_hash_remove (fullpath);
     482
    479483  return retval;
    480484}
     
    537541      SL_RET0(_("hash_unvisited"));
    538542    }
    539 #if 0
    540   if (!strcmp(p->fullpath, "/var/lib/synaptic"))
    541     {
    542       fprintf(stderr, "FIXME: Check for missing files %s\n", p->fullpath);
    543       if (SH_FFLAG_VISITED_SET(p->fflags)) fprintf(stderr, "FIXME: visited\n");
    544       if (SH_FFLAG_CHECKED_SET(p->fflags)) fprintf(stderr, "FIXME: checked\n");
    545       if (SH_FFLAG_REPORTED_SET(p->fflags)) fprintf(stderr, "FIXME: reported\n");
    546       if (SH_FFLAG_ALLIGNORE_SET(p->fflags)) fprintf(stderr, "FIXME: allignore\n");
    547     }
    548 #endif
     543
    549544  /* visited   flag not set: not seen;
    550545   * checked   flag     set: not seen (i.e. missing), and already checked
     
    560555    {
    561556      i = retry_lstat(FIL__, __LINE__, p->fullpath, &buf);
    562 #if 0
    563       if (!strcmp(p->fullpath, "/var/lib/synaptic"))
    564         fprintf(stderr, "FIXME: Check for missing files %s (%d)\n", p->fullpath, i);
    565 #endif
     557
    566558     /* if file does not exist
    567559       */
     
    653645  CLEAR_SH_FFLAG_VISITED(p->fflags);
    654646  CLEAR_SH_FFLAG_CHECKED(p->fflags);
     647  SET_SH_FFLAG_ENOENT(p->fflags);
    655648
    656649  SL_RET0(_("hash_unvisited"));
     
    22022195/* needs lock to be threadsafe
    22032196 */
    2204 void sh_hash_addflag (char * filename, int flag_to_set)
     2197void sh_hash_set_flag (char * filename, int flag_to_set)
    22052198{
    22062199  sh_file_t * p;
     
    22182211  return;
    22192212}
     2213
     2214/* needs lock to be threadsafe
     2215 */
     2216void sh_hash_clear_flag (char * filename, int flag_to_clear)
     2217{
     2218  sh_file_t * p;
     2219
     2220  if (IsInit != 1)
     2221    sh_hash_init();
     2222
     2223  SH_MUTEX_LOCK(mutex_hash);
     2224  p = sh_hash_have_it_int (filename);
     2225  if (p)
     2226    {
     2227      p->fflags &= ~flag_to_clear;
     2228    }
     2229  SH_MUTEX_UNLOCK(mutex_hash);
     2230  return;
     2231}
     2232
    22202233
    22212234/*****************************************************************
Note: See TracChangeset for help on using the changeset viewer.