瀏覽代碼

introduce and use pending_wakeup()

so we don't need to peek into internal data structures.
Oswald Buddenhagen 10 年之前
父節點
當前提交
f4240761f1
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 0
      src/common.h
  2. 1 1
      src/drv_maildir.c

+ 1 - 0
src/common.h

@@ -164,6 +164,7 @@ typedef struct {
 void init_wakeup( wakeup_t *tmr, void (*cb)( void * ), void *aux );
 void init_wakeup( wakeup_t *tmr, void (*cb)( void * ), void *aux );
 void conf_wakeup( wakeup_t *tmr, int timeout );
 void conf_wakeup( wakeup_t *tmr, int timeout );
 void wipe_wakeup( wakeup_t *tmr );
 void wipe_wakeup( wakeup_t *tmr );
+static INLINE int pending_wakeup( wakeup_t *tmr ) { return tmr->links.next != 0; }
 
 
 void main_loop( void );
 void main_loop( void );
 
 

+ 1 - 1
src/drv_maildir.c

@@ -529,7 +529,7 @@ maildir_uidval_lock( maildir_store_t *ctx )
 #endif
 #endif
 	char buf[128];
 	char buf[128];
 
 
-	if (ctx->lcktmr.links.next) {
+	if (pending_wakeup( &ctx->lcktmr )) {
 		/* The unlock timer is active, so we are obviously already locked. */
 		/* The unlock timer is active, so we are obviously already locked. */
 		return DRV_OK;
 		return DRV_OK;
 	}
 	}