From: Herbert Xu <herbert@gondor.apana.org.au>
To: dash@vger.kernel.org
Subject: [PATCH] main: Fix profiling on longjmp exit paths
Date: Sat, 27 Apr 2024 17:11:31 +0800 [thread overview]
Message-ID: <ZizBQ4KYRqO4B3Bc@gondor.apana.org.au> (raw)
Ensure that longjmp exit paths also write the profiling file.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
src/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c
index 5c49fdc..7beb280 100644
--- a/src/main.c
+++ b/src/main.c
@@ -112,7 +112,7 @@ main(int argc, char **argv)
s = state;
if (e == EXEND || e == EXEXIT || s == 0 || iflag == 0 || shlvl)
- exitshell();
+ goto exit;
reset();
@@ -175,6 +175,7 @@ state3:
state4: /* XXX ??? - why isn't this before the "if" statement */
cmdloop(1);
}
+exit:
#if PROFILE
monitor(0);
#endif
--
2.39.2
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
reply other threads:[~2024-04-27 9:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZizBQ4KYRqO4B3Bc@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).