Changeset 5119:d12143e1a610

Show
Ignore:
Timestamp:
2007-04-10 19:28:14 (21 months ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Try to unlink old header cache if open fails

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • hcache.c

    r5117 r5119  
    983983  struct header_cache *h = safe_calloc(1, sizeof (HEADER_CACHE)); 
    984984  int (*hcache_open) (struct header_cache* h, const char* path); 
     985  struct stat sb; 
    985986 
    986987#if HAVE_QDBM 
     
    10091010  else 
    10101011  { 
     1012    /* remove a possibly incompatible version */ 
     1013    if (!stat (path, &sb) && !unlink (path)) 
     1014    { 
     1015      if (!hcache_open (h, path)) 
     1016        return h; 
     1017    } 
    10111018    FREE(&h->folder); 
    10121019    FREE(&h);