diff options
author | Vitaly Buka <vitalybuka@google.com> | 2023-02-18 12:53:41 -0800 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-02-20 09:32:43 -0300 |
commit | fd78cfa72ea2bab30fdb4e1e0672b34471426c05 (patch) | |
tree | 7c4c6a183334e56033fc151b7d6e784b0c1cec5f /stdlib/exit.c | |
parent | b5b27ff1519d6ca20efcec46bc26964e1c7da68a (diff) | |
download | glibc-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.c | 7 |
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; |