Required, becuase the contents of errno are undefined unless the
previous library call returned an error. Errno is NOT cleared on a
successful library call.
}
d->entry = readdir(d->td); /* skip . and .. */
d->entry = readdir(d->td);
- if (errno == ENOENT)
+ if (d->entry == NULL && errno == ENOENT)
debug(20, 1) ("storeGetNextFile: directory does not exist!.\n");
debug(20, 3) ("storeGetNextFile: Directory %s\n", d->fullpath);
}