Commit 223ff71a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Do the zero check last, so a varnishd restart has a chance to recover it.

parent 2da67725
......@@ -173,13 +173,6 @@ vsl_nextlog(struct vsl *vsl, uint32_t **pp)
for (w = 0; w < TIMEOUT_USEC;) {
t = *vsl->log_ptr;
if (t == 0) {
/* Zero-initialized VSL */
w += SLEEP_USEC;
assert(usleep(SLEEP_USEC) == 0 || errno == EINTR);
VRMB();
continue;
}
if (t == VSL_WRAPMARKER) {
/* Wrap around not possible at front */
assert(vsl->log_ptr != vsl->log_start + 1);
......@@ -202,6 +195,13 @@ vsl_nextlog(struct vsl *vsl, uint32_t **pp)
VRMB();
continue;
}
if (t == 0) {
/* Zero-initialized VSL */
w += SLEEP_USEC;
assert(usleep(SLEEP_USEC) == 0 || errno == EINTR);
VRMB();
continue;
}
if (vsl->log_ptr == vsl->log_start + 1)
vsl->last_seq = vsl->log_start[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment