From 362c47553b713f6d6285c6bd790fa8a86e466c82 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 7 Oct 2022 09:38:20 +0200 Subject: [PATCH] Fix ovnisort handling of last event --- src/sort.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sort.c b/src/sort.c index 972c123..c6a73d9 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2021 Barcelona Supercomputing Center (BSC) +/* Copyright (c) 2021-2022 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ /* This program is a really bad idea. It attempts to sort streams by using a @@ -241,8 +241,7 @@ stream_winsort(struct ovni_stream *stream, struct ring *r) size_t updated = 0; char st = 'S'; - while (stream->active) { - ovni_load_next_event(stream); + while (ovni_load_next_event(stream) == 0) { struct ovni_ev *ev = stream->cur_ev; if (st == 'S' && starts_unsorted_region(ev)) {