* mu-maildir.c: small cleanups
This commit is contained in:
@ -472,8 +472,7 @@ process_dir_entries (DIR *dir, const char* path, const char* mdir,
|
|||||||
MuError result;
|
MuError result;
|
||||||
GSList *lst, *c;
|
GSList *lst, *c;
|
||||||
|
|
||||||
lst = NULL;
|
for (lst = NULL;;) {
|
||||||
for (;;) {
|
|
||||||
int rv;
|
int rv;
|
||||||
struct dirent *entry, *res;
|
struct dirent *entry, *res;
|
||||||
entry = dirent_new ();
|
entry = dirent_new ();
|
||||||
@ -487,28 +486,20 @@ process_dir_entries (DIR *dir, const char* path, const char* mdir,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dirent_destroy (entry);
|
dirent_destroy (entry);
|
||||||
g_warning ("error scanning dir: %s",
|
g_warning ("error scanning dir: %s", strerror(rv));
|
||||||
strerror(rv));
|
|
||||||
return MU_ERROR_FILE;
|
return MU_ERROR_FILE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* we sort by inode; this makes things much faster on
|
/* we sort by inode; this makes things much faster on
|
||||||
* extfs2,3 */
|
* extfs2,3 */
|
||||||
#if HAVE_STRUCT_DIRENT_D_INO
|
#if HAVE_STRUCT_DIRENT_D_INO
|
||||||
c = lst = g_slist_sort (lst, (GCompareFunc)dirent_cmp);
|
c = lst = g_slist_sort (lst, (GCompareFunc)dirent_cmp);
|
||||||
#endif /*HAVE_STRUCT_DIRENT_D_INO*/
|
#endif /*HAVE_STRUCT_DIRENT_D_INO*/
|
||||||
|
|
||||||
for (c = lst, result = MU_OK; c && result == MU_OK;
|
for (c = lst, result = MU_OK; c && result == MU_OK; c = g_slist_next(c))
|
||||||
c = g_slist_next(c)) {
|
result = process_dir_entry (path, mdir, (struct dirent*)c->data,
|
||||||
result = process_dir_entry (path, mdir,
|
|
||||||
(struct dirent*)c->data,
|
|
||||||
msg_cb, dir_cb, data);
|
msg_cb, dir_cb, data);
|
||||||
/* hmmm, break on MU_ERROR as well? */
|
|
||||||
if (result == MU_STOP)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_slist_foreach (lst, (GFunc)dirent_destroy, NULL);
|
g_slist_foreach (lst, (GFunc)dirent_destroy, NULL);
|
||||||
g_slist_free (lst);
|
g_slist_free (lst);
|
||||||
|
|||||||
Reference in New Issue
Block a user