Commit Diff
- Commit:
757865b2dc1e19bc19acf8fd37daeccef302633d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
- Message:
- ev: add explicit check min can't possibly be un-initialized, since poll(2) returns zero only when the timeout expires. However, this should please some checkers (looking at you, fortify/string.h!) and doesn't cost anything.
- Actions:
- Patch | Tree
--- 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);