* configure.ac, mu-maildir.c: some compatibility updates

This commit is contained in:
Dirk-Jan C. Binnema
2010-01-16 11:32:07 +02:00
parent 5fd98d2e2e
commit 6f48dbed79
2 changed files with 40 additions and 15 deletions

View File

@ -17,6 +17,8 @@
**
*/
#include "config.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -398,11 +400,13 @@ dirent_destroy (struct dirent *entry)
g_slice_free(struct dirent, entry);
}
#ifdef HAVE_STRUCT_DIRENT_D_INO
static gint
dirent_cmp (struct dirent *d1, struct dirent *d2)
{
return d1->d_ino - d2->d_ino;
}
#endif /*HAVE_STRUCT_DIRENT_D_INO*/
static MuResult
process_dir (const char* path, MuMaildirWalkMsgCallback msg_cb,
@ -438,8 +442,10 @@ process_dir (const char* path, MuMaildirWalkMsgCallback msg_cb,
lst = g_list_prepend (lst, dirent_copy(entry));
}
#if HAVE_STRUCT_DIRENT_D_INO
c = lst = g_list_sort (lst, (GCompareFunc)dirent_cmp);
#endif /*HAVE_STRUCT_DIRENT_D_INO*/
for (c = lst, result = MU_OK; c && result == MU_OK; c = c->next)
result = process_dir_entry (path, (struct dirent*)c->data,
msg_cb, dir_cb, data);
@ -491,7 +497,6 @@ mu_maildir_walk (const char *path, MuMaildirWalkMsgCallback cb_msg,
}
static gboolean
clear_links (const gchar* dirname, DIR *dir)
{