fix for non-standard opendir() on reiserfs
This commit is contained in:
parent
b45bd9059e
commit
38e36613c9
|
@ -846,8 +846,14 @@ static int run_dir(char *topdir, char *dir, struct Qthread_t *tlist, int num_thr
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((dp = readdir(dirp)) != NULL)
|
while ((dp = readdir(dirp)) != NULL) {
|
||||||
if ((dp->d_type & DT_REG) &&
|
struct stat st;
|
||||||
|
Octstr *xfname = octstr_format("%s%s", xdir, dp->d_name);
|
||||||
|
int sres = stat(octstr_get_cstr(xfname), &st);
|
||||||
|
|
||||||
|
octstr_destroy(xfname);
|
||||||
|
|
||||||
|
if (sres == 0 && S_ISREG(st.st_mode) &&
|
||||||
dp->d_name[0] == MQF &&
|
dp->d_name[0] == MQF &&
|
||||||
dp->d_name[1] == 'f') {
|
dp->d_name[1] == 'f') {
|
||||||
Octstr *xqf = xmake_qf(dp->d_name, dir);
|
Octstr *xqf = xmake_qf(dp->d_name, dir);
|
||||||
|
@ -881,12 +887,13 @@ static int run_dir(char *topdir, char *dir, struct Qthread_t *tlist, int num_thr
|
||||||
} else
|
} else
|
||||||
free_envelope(e,0); /* Let go of it. */
|
free_envelope(e,0); /* Let go of it. */
|
||||||
|
|
||||||
} else if ((dp->d_type & DT_DIR) &&
|
} else if (sres == 0 && S_ISDIR(st.st_mode) &&
|
||||||
strcmp(dp->d_name, ".") != 0 &&
|
strcmp(dp->d_name, ".") != 0 &&
|
||||||
strcmp(dp->d_name, "..") != 0) {
|
strcmp(dp->d_name, "..") != 0) {
|
||||||
Octstr *newdir = octstr_format("%s%s/", dir, dp->d_name);
|
Octstr *newdir = octstr_format("%s%s/", dir, dp->d_name);
|
||||||
list_append(stack, newdir); /* push it... */
|
list_append(stack, newdir); /* push it... */
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (dirp) closedir(dirp);
|
if (dirp) closedir(dirp);
|
||||||
done:
|
done:
|
||||||
if (tdir)
|
if (tdir)
|
||||||
|
|
|
@ -391,8 +391,7 @@ static int mms_load_ua_profile_cache(char *dir)
|
||||||
|
|
||||||
|
|
||||||
if (strcmp(dp->d_name, ".") == 0 ||
|
if (strcmp(dp->d_name, ".") == 0 ||
|
||||||
strcmp(dp->d_name, "..") == 0 ||
|
strcmp(dp->d_name, "..") == 0) /* A directory, skip. */
|
||||||
dp->d_type & DT_DIR) /* If a directory, keep going. */
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fname = octstr_format("%.255s/%.254s", dir, dp->d_name);
|
fname = octstr_format("%.255s/%.254s", dir, dp->d_name);
|
||||||
|
|
Loading…
Reference in New Issue