* mu-maildir: return right MuResult from callback

This commit is contained in:
Dirk-Jan C. Binnema 2010-09-12 21:39:15 +03:00
parent 26f216efef
commit 1a8de6e1db
1 changed files with 6 additions and 5 deletions

View File

@ -519,13 +519,14 @@ process_dir (const char* path, const char* mdir,
dir = opendir (path);
if (G_UNLIKELY(!dir)) {
g_warning ("%s: ignoring %s: %s", path,
__FUNCTION__, strerror(errno));
g_warning ("%s: ignoring %s: %s", __FUNCTION__,
path, strerror(errno));
return MU_OK;
}
if (dir_cb) {
MuResult rv = dir_cb (path, TRUE, data);
MuResult rv;
rv = dir_cb (path, TRUE, data);
if (rv != MU_OK) {
closedir (dir);
return rv;
@ -534,10 +535,10 @@ process_dir (const char* path, const char* mdir,
result = process_dir_entries_sorted (dir, path, mdir, msg_cb, dir_cb,
data);
closedir (dir);
if (dir_cb)
/* only run dir_cb if it exists and so far, things went ok */
if (dir_cb && result == MU_OK)
return dir_cb (path, FALSE, data);
return result;