From df86a2a8c8725ac6244a222d399a5b959101f621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 1 Oct 2022 15:28:41 +0200 Subject: Finalization thread exits when it gets EOF on its pipe. Avoids spurious "error in finalization thread: Success" messages when the finalization pipe gets closed. * libguile/finalizers.c (finalization_thread_proc): Return when 'data.n' is zero. --- libguile/finalizers.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libguile/finalizers.c b/libguile/finalizers.c index 5122e5fe3..1370755bf 100644 --- a/libguile/finalizers.c +++ b/libguile/finalizers.c @@ -1,4 +1,4 @@ -/* Copyright 2012-2014,2018-2020 +/* Copyright 2012-2014,2018-2020,2022 Free Software Foundation, Inc. This file is part of Guile. @@ -226,8 +226,11 @@ finalization_thread_proc (void *unused) struct finalization_pipe_data data; scm_without_guile (read_finalization_pipe_data, &data); - - if (data.n <= 0) + + if (data.n == 0) + /* The other end of the pipe was closed, so exit. */ + return NULL; + else if (data.n < 0) { if (data.err != EINTR) { -- cgit v1.2.1