Commit Diff


commit - 7d7bc744695ff195293e6d0ce990e5be28285730
commit + 757865b2dc1e19bc19acf8fd37daeccef302633d
blob - 00ab8adabeac5e48038f76b90bd4052a7c617a69
blob + e4e3e53cfc07f56260101ab678ed655da6a8b8fc
--- ev.c
+++ ev.c
@@ -435,6 +435,7 @@ ev_loop(void)
 		base->reserve_from = base->ntimers;
 		base->reserve_till = base->ntimers;
 
+		min = NULL;
 		msec = -1;
 		if (base->ntimers) {
 			min = &base->timers[0].tv;	
@@ -447,7 +448,7 @@ ev_loop(void)
 				return -1;
 		}
 
-		if (n == 0)
+		if (n == 0 && min)
 			memcpy(&tv, min, sizeof(tv));
 		else {
 			clock_gettime(CLOCK_MONOTONIC, &end);