aboutsummaryrefslogtreecommitdiff
path: root/stdlib/exit.c
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2023-02-18 12:53:41 -0800
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-20 09:32:43 -0300
commitfd78cfa72ea2bab30fdb4e1e0672b34471426c05 (patch)
tree7c4c6a183334e56033fc151b7d6e784b0c1cec5f /stdlib/exit.c
parentb5b27ff1519d6ca20efcec46bc26964e1c7da68a (diff)
downloadglibc-fd78cfa72ea2bab30fdb4e1e0672b34471426c05.zip
glibc-fd78cfa72ea2bab30fdb4e1e0672b34471426c05.tar.gz
glibc-fd78cfa72ea2bab30fdb4e1e0672b34471426c05.tar.bz2
stdlib: Undo post review change to 16adc58e73f3 [BZ #27749]
Post review removal of "goto restart" from https://sourceware.org/pipermail/libc-alpha/2021-April/125470.html introduced a bug when some atexit handers skipped. Signed-off-by: Vitaly Buka <vitalybuka@google.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'stdlib/exit.c')
-rw-r--r--stdlib/exit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/stdlib/exit.c b/stdlib/exit.c
index 6b1eed6..1cd0bdf 100644
--- a/stdlib/exit.c
+++ b/stdlib/exit.c
@@ -51,7 +51,10 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
exit (). */
while (true)
{
- struct exit_function_list *cur = *listp;
+ struct exit_function_list *cur;
+
+ restart:
+ cur = *listp;
if (cur == NULL)
{
@@ -113,7 +116,7 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
if (__glibc_unlikely (new_exitfn_called != __new_exitfn_called))
/* The last exit function, or another thread, has registered
more exit functions. Start the loop over. */
- continue;
+ goto restart;
}
*listp = cur->next;