From 09af804b422b9d9b29b6f0532b6308be0c20a8d8 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 12 Jul 2004 00:09:30 +0300 Subject: [PATCH] Use CMP_DEV_T() macro to compare struct stat.st_dev --HG-- branch : HEAD --- src/lib-index/mail-transaction-log.c | 4 ++-- src/lib-storage/index/index-storage.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib-index/mail-transaction-log.c b/src/lib-index/mail-transaction-log.c index 82fcd699bd..275f619ebd 100644 --- a/src/lib-index/mail-transaction-log.c +++ b/src/lib-index/mail-transaction-log.c @@ -360,7 +360,7 @@ mail_transaction_log_file_create2(struct mail_transaction_log *log, if ((ret = fstat(fd2, &st)) < 0) { mail_index_file_set_syscall_error(index, path, "fstat()"); - } else if (st.st_dev == dev && st.st_ino == ino) { + } else if (st.st_ino == ino && CMP_DEV_T(st.st_dev, dev)) { /* same file, still broken */ } else { (void)file_dotlock_delete(path, LOG_NEW_DOTLOCK_SUFFIX, @@ -626,7 +626,7 @@ static int mail_transaction_log_refresh(struct mail_transaction_log *log) if (log->head != NULL && log->head->st_ino == st.st_ino && - log->head->st_dev == st.st_dev) { + CMP_DEV_T(log->head->st_dev, st.st_dev)) { /* same file */ ret = mail_transaction_log_file_read_hdr(log->head, &st); if (ret == 0 && log->head->lock_type == F_WRLCK) { diff --git a/src/lib-storage/index/index-storage.c b/src/lib-storage/index/index-storage.c index 9060c49433..97f976032c 100644 --- a/src/lib-storage/index/index-storage.c +++ b/src/lib-storage/index/index-storage.c @@ -94,7 +94,7 @@ index_storage_alloc(const char *index_dir, const char *mailbox_path, rec = *list; if ((index_dir != NULL && st.st_ino == rec->index_dir_ino && - st.st_dev == rec->index_dir_dev) || + CMP_DEV_T(st.st_dev, rec->index_dir_dev)) || (index_dir == NULL && st.st_ino == 0 && strcmp(mailbox_path, rec->mailbox_path) == 0)) { rec->refcount++; -- 2.47.3