]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib, lib-storage: Move INOTIFY_ST_CHANGED to ST_CHANGED in lib
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 6 Jul 2017 11:44:40 +0000 (14:44 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 6 Jul 2017 11:44:40 +0000 (14:44 +0300)
Allows reusing this elsewhere

src/lib-storage/list/mailbox-list-index-notify.c
src/lib/macros.h

index d3516208df74be5895b1db9b4bb7c6d0e97321f4..38b132caf4ecbabb6315ed2b1ba3e21733e397d3 100644 (file)
@@ -812,19 +812,14 @@ static void notify_now_callback(struct mailbox_list_notify_index *inotify)
 
 static void notify_callback(struct mailbox_list_notify_index *inotify)
 {
-#define INOTIFY_ST_CHANGED(last_st, prev_st) \
-       ((last_st).st_mtime != (prev_st).st_mtime || \
-        ST_MTIME_NSEC(last_st) != ST_MTIME_NSEC(prev_st) || \
-        (last_st).st_size != (prev_st).st_size || \
-        (last_st).st_ino != (prev_st).st_ino)
        struct stat list_prev_st = inotify->list_last_st;
        struct stat inbox_prev_st = inotify->inbox_last_st;
                         
        notify_update_stat(inotify);
-       if (INOTIFY_ST_CHANGED(inotify->inbox_last_st, inbox_prev_st))
+       if (ST_CHANGED(inotify->inbox_last_st, inbox_prev_st))
                inotify->inbox_event_pending = TRUE;
        if (inotify->inbox_event_pending ||
-           INOTIFY_ST_CHANGED(inotify->list_last_st, list_prev_st)) {
+           ST_CHANGED(inotify->list_last_st, list_prev_st)) {
                /* log has changed. call the callback with a small delay
                   to allow bundling multiple changes together */
                if (inotify->to_notify != NULL) {
index a3878b1f00cb6b86bdb23607d05cb125e40c532e..4f95dc4f98f38cc7c1d1a6d5930bda8e0383f819 100644 (file)
 #define i_zero(p) memset(p, 0, sizeof(*(p)))
 #define i_zero_safe(p) safe_memset(p, 0, sizeof(*(p)))
 
+#define ST_CHANGED(st_a, st_b) \
+       ((st_a).st_mtime != (st_b).st_mtime || \
+        ST_MTIME_NSEC(st_a) != ST_MTIME_NSEC(st_b) || \
+        (st_a).st_size != (st_b).st_size || \
+        (st_a).st_ino != (st_b).st_ino)
+
 #endif