* mu-maildir: use ctime instead of mtime, some cosmetics
This commit is contained in:
@ -215,7 +215,11 @@ process_file (const char* fullpath, MuMaildirWalkMsgCallback cb, void *data)
|
|||||||
return MU_OK; /* not an error */
|
return MU_OK; /* not an error */
|
||||||
}
|
}
|
||||||
|
|
||||||
result = (cb)(fullpath,statbuf.st_mtime,data);
|
/*
|
||||||
|
* use the ctime, so any status change will be visible (perms,
|
||||||
|
* filename etc.)
|
||||||
|
*/
|
||||||
|
result = (cb)(fullpath,statbuf.st_ctime,data);
|
||||||
|
|
||||||
if (G_LIKELY(result == MU_OK || result == MU_STOP))
|
if (G_LIKELY(result == MU_OK || result == MU_STOP))
|
||||||
return result;
|
return result;
|
||||||
@ -323,6 +327,8 @@ process_dir_entry (const char* path, struct dirent *entry,
|
|||||||
sprintf (fullpath, "%s%c%s", path, G_DIR_SEPARATOR,
|
sprintf (fullpath, "%s%c%s", path, G_DIR_SEPARATOR,
|
||||||
entry->d_name);
|
entry->d_name);
|
||||||
|
|
||||||
|
g_debug ("looking at: %s", fullpath);
|
||||||
|
|
||||||
switch (entry->d_type) {
|
switch (entry->d_type) {
|
||||||
case DT_REG:
|
case DT_REG:
|
||||||
/* we only want files in cur/ and new/ */
|
/* we only want files in cur/ and new/ */
|
||||||
@ -372,7 +378,7 @@ static MuResult
|
|||||||
process_dir (const char* path, MuMaildirWalkMsgCallback msg_cb,
|
process_dir (const char* path, MuMaildirWalkMsgCallback msg_cb,
|
||||||
MuMaildirWalkDirCallback dir_cb, void *data)
|
MuMaildirWalkDirCallback dir_cb, void *data)
|
||||||
{
|
{
|
||||||
MuResult result = MU_OK;
|
MuResult result;
|
||||||
GList *lst, *c;
|
GList *lst, *c;
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
DIR* dir;
|
DIR* dir;
|
||||||
@ -398,7 +404,7 @@ process_dir (const char* path, MuMaildirWalkMsgCallback msg_cb,
|
|||||||
lst = g_list_prepend (lst, dirent_copy(entry));
|
lst = g_list_prepend (lst, dirent_copy(entry));
|
||||||
|
|
||||||
c = lst = g_list_sort (lst, (GCompareFunc)dirent_cmp);
|
c = lst = g_list_sort (lst, (GCompareFunc)dirent_cmp);
|
||||||
for (c = lst; c && result == MU_OK; c = c->next)
|
for (c = lst, result = MU_OK; c && result == MU_OK; c = c->next)
|
||||||
result = process_dir_entry (path, (struct dirent*)c->data,
|
result = process_dir_entry (path, (struct dirent*)c->data,
|
||||||
msg_cb, dir_cb, data);
|
msg_cb, dir_cb, data);
|
||||||
|
|
||||||
@ -444,6 +450,7 @@ mu_maildir_walk (const char *path, MuMaildirWalkMsgCallback cb_msg,
|
|||||||
|
|
||||||
g_warning ("%s: unsupported file type for %s",
|
g_warning ("%s: unsupported file type for %s",
|
||||||
__FUNCTION__, path);
|
__FUNCTION__, path);
|
||||||
|
|
||||||
return MU_ERROR;
|
return MU_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,6 +512,7 @@ mu_maildir_clear_links (const gchar* path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_debug ("remove symlinks from %s", path);
|
g_debug ("remove symlinks from %s", path);
|
||||||
|
|
||||||
rv = _clear_links (path, dir);
|
rv = _clear_links (path, dir);
|
||||||
closedir (dir);
|
closedir (dir);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user