From: GNU Libc Maintainers Date: Wed, 30 Apr 2025 01:01:35 +0000 (+0800) Subject: git-register-atfork2 X-Git-Tag: archive/raspbian/2.31-13+rpi1+deb11u12^2~101 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e21a35dd5ccb3c504cf9ccdb5d504ab10bba7db2;p=glibc.git git-register-atfork2 Committed for glibc 2.32 commit 05039737d306b4c065ff65d4f90042f3ec8f6ddf Author: Samuel Thibault Date: Sun Jun 7 02:57:04 2020 +0200 htl: fix register-atfork ordering * htl/register-atfork.c (__register_atfork): Add new hooks at the end of the list instead of the beginning. Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name git-register-atfork2.diff --- diff --git a/htl/register-atfork.c b/htl/register-atfork.c index 256b1148a..4581ac5bb 100644 --- a/htl/register-atfork.c +++ b/htl/register-atfork.c @@ -109,15 +109,15 @@ __register_atfork (void (*prepare) (void), new->parent = parent; new->child = child; new->dso_handle = dso_handle; - new->prev = NULL; + new->next = NULL; __libc_lock_lock (atfork_lock); - new->next = fork_handlers; - if (fork_handlers != NULL) - fork_handlers->prev = new; - fork_handlers = new; - if (fork_last_handler == NULL) - fork_last_handler = new; + new->prev = fork_last_handler; + if (fork_last_handler != NULL) + fork_last_handler->next = new; + if (fork_handlers == NULL) + fork_handlers = new; + fork_last_handler = new; __libc_lock_unlock (atfork_lock); return 0;