From 6627adcbc2d2ade8db1fd2ed26e03d37b53fde62 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Thu, 13 Jun 2024 17:27:08 +0530 Subject: util/json_streaming_read: properly handle EOF --- src/queue.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/queue.c') diff --git a/src/queue.c b/src/queue.c index 5c196aa..6bf9092 100644 --- a/src/queue.c +++ b/src/queue.c @@ -16,9 +16,10 @@ void *queue_thread_entry(void *queue_thread) while (true) { ret = job_read(qt->stream, &job); - if (ret < 0) { - if (ret == -EOF) - ret = 0; + if (ret == -EOF) { + ret = 0; + break; + } else if (ret < 0) { break; } -- cgit v1.2.3