Fix ovnisort check operation
The stream_step() function will return 1 when reaching the end of the stream, making the check return non-zero in each stream, even if all the events have a monotonically increasing clock.
This commit is contained in:
parent
3d8e2000fd
commit
34a823f36d
@ -320,6 +320,7 @@ stream_check(struct stream *stream)
|
|||||||
|
|
||||||
struct ovni_ev *ev = stream_ev(stream);
|
struct ovni_ev *ev = stream_ev(stream);
|
||||||
uint64_t last_clock = ev->header.clock;
|
uint64_t last_clock = ev->header.clock;
|
||||||
|
int backjump = 0;
|
||||||
|
|
||||||
while ((ret = stream_step(stream)) == 0) {
|
while ((ret = stream_step(stream)) == 0) {
|
||||||
ev = stream_ev(stream);
|
ev = stream_ev(stream);
|
||||||
@ -328,7 +329,7 @@ stream_check(struct stream *stream)
|
|||||||
if (cur_clock < last_clock) {
|
if (cur_clock < last_clock) {
|
||||||
err("backwards jump in time %ld -> %ld for stream %s",
|
err("backwards jump in time %ld -> %ld for stream %s",
|
||||||
last_clock, cur_clock, stream->relpath);
|
last_clock, cur_clock, stream->relpath);
|
||||||
ret = -1;
|
backjump = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
last_clock = cur_clock;
|
last_clock = cur_clock;
|
||||||
@ -339,7 +340,10 @@ stream_check(struct stream *stream)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
if (backjump)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user