*/
static int mbox_mbox_check_stats(struct Mailbox *m, int flags)
{
- struct stat *sb = { 0 };
- stat(m->path, sb);
+ struct stat sb = { 0 };
+ stat(m->path, &sb);
bool new_or_changed;
if (CheckMboxSize)
- new_or_changed = (sb->st_size > m->size);
+ new_or_changed = (sb.st_size > m->size);
else
{
new_or_changed =
- (mutt_file_stat_compare(sb, MUTT_STAT_MTIME, sb, MUTT_STAT_ATIME) > 0) ||
+ (mutt_file_stat_compare(&sb, MUTT_STAT_MTIME, &sb, MUTT_STAT_ATIME) > 0) ||
(m->newly_created &&
- (mutt_file_stat_compare(sb, MUTT_STAT_CTIME, sb, MUTT_STAT_MTIME) == 0) &&
- (mutt_file_stat_compare(sb, MUTT_STAT_CTIME, sb, MUTT_STAT_ATIME) == 0));
+ (mutt_file_stat_compare(&sb, MUTT_STAT_CTIME, &sb, MUTT_STAT_MTIME) == 0) &&
+ (mutt_file_stat_compare(&sb, MUTT_STAT_CTIME, &sb, MUTT_STAT_ATIME) == 0));
}
if (new_or_changed)
{
if (!MailCheckRecent ||
- (mutt_file_stat_timespec_compare(sb, MUTT_STAT_MTIME, &m->last_visited) > 0))
+ (mutt_file_stat_timespec_compare(&sb, MUTT_STAT_MTIME, &m->last_visited) > 0))
{
m->has_new = true;
}
else if (CheckMboxSize)
{
/* some other program has deleted mail from the folder */
- m->size = (off_t) sb->st_size;
+ m->size = (off_t) sb.st_size;
}
- if (m->newly_created && (sb->st_ctime != sb->st_mtime || sb->st_ctime != sb->st_atime))
+ if (m->newly_created && (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
m->newly_created = false;
- if (mutt_file_stat_timespec_compare(sb, MUTT_STAT_MTIME, &m->stats_last_checked) > 0)
+ if (mutt_file_stat_timespec_compare(&sb, MUTT_STAT_MTIME, &m->stats_last_checked) > 0)
{
struct Context *ctx =
mx_mbox_open(m, NULL, MUTT_READONLY | MUTT_QUIET | MUTT_NOSORT | MUTT_PEEK);