Don't warn about broken symlinks.
This commit is contained in:
@@ -106,11 +106,15 @@ void FileSet::LoadFromDir(const CString &dir)
|
|||||||
struct stat st;
|
struct stat st;
|
||||||
if( stat(ent->d_name, &st) == -1 )
|
if( stat(ent->d_name, &st) == -1 )
|
||||||
{
|
{
|
||||||
|
/* If it's a broken symlink, ignore it. Otherwise, warn. */
|
||||||
|
if( lstat(ent->d_name, &st) == 0 )
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Huh? */
|
/* Huh? */
|
||||||
if(LOG)
|
if(LOG)
|
||||||
LOG->Warn("Got file '%s' in '%s' from list, but can't stat? (%s)",
|
LOG->Warn("Got file '%s' in '%s' from list, but can't stat? (%s)",
|
||||||
ent->d_name, dir.c_str(), strerror(errno));
|
ent->d_name, dir.c_str(), strerror(errno));
|
||||||
f.dir = false;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
f.dir = (st.st_mode & S_IFDIR);
|
f.dir = (st.st_mode & S_IFDIR);
|
||||||
f.size = st.st_size;
|
f.size = st.st_size;
|
||||||
|
|||||||
Reference in New Issue
Block a user