* mu-maildir: return right MuResult from callback
This commit is contained in:
@ -519,13 +519,14 @@ process_dir (const char* path, const char* mdir,
|
|||||||
|
|
||||||
dir = opendir (path);
|
dir = opendir (path);
|
||||||
if (G_UNLIKELY(!dir)) {
|
if (G_UNLIKELY(!dir)) {
|
||||||
g_warning ("%s: ignoring %s: %s", path,
|
g_warning ("%s: ignoring %s: %s", __FUNCTION__,
|
||||||
__FUNCTION__, strerror(errno));
|
path, strerror(errno));
|
||||||
return MU_OK;
|
return MU_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir_cb) {
|
if (dir_cb) {
|
||||||
MuResult rv = dir_cb (path, TRUE, data);
|
MuResult rv;
|
||||||
|
rv = dir_cb (path, TRUE, data);
|
||||||
if (rv != MU_OK) {
|
if (rv != MU_OK) {
|
||||||
closedir (dir);
|
closedir (dir);
|
||||||
return rv;
|
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,
|
result = process_dir_entries_sorted (dir, path, mdir, msg_cb, dir_cb,
|
||||||
data);
|
data);
|
||||||
|
|
||||||
closedir (dir);
|
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 dir_cb (path, FALSE, data);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user