Changeset 2535

Show
Ignore:
Timestamp:
09/05/07 11:30:58 (1 year ago)
Author:
maxr
Message:

Fix wrong assumption that first two call of readdir return . and ..
It's wrong on current Gentoo Linux 2.6.22.1 on ext3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/contrib/make/dir.c

    r85 r2535  
    927927    if ((d = opendir(p->name)) == NULL) 
    928928        return NULL; 
    929     /* Skip the first two entries -- these will *always* be . and ..  */ 
    930     (void)readdir(d); 
    931     (void)readdir(d); 
    932929 
    933930    while ((dp = readdir(d)) != NULL) { 
     931        if (strcmp (dp->d_name, ".") == 0 || strcmp (dp->d_name, "..") == 0) 
     932           continue; 
    934933#if defined(sun) && defined(d_ino) /* d_ino is a sunos4 #define for d_fileno */ 
    935934        /* The sun directory library doesn't check for a 0 inode