public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-patches@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH 3/5] Cygwin: Define and use __WCOREFLAG
Date: Fri, 12 Jan 2024 14:09:54 +0000	[thread overview]
Message-ID: <20240112140958.1694-4-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20240112140958.1694-1-jon.turney@dronecode.org.uk>

Also fix a typo in description of exit status
---
 winsup/cygwin/exceptions.cc         | 2 +-
 winsup/cygwin/include/cygwin/wait.h | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 6bd34392a..05ffdc27e 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -1334,7 +1334,7 @@ signal_exit (int sig, siginfo_t *si, void *)
 	if (cygheap->rlim_core == 0Ul)
 	  break;
 
-	sig |= 0x80; /* Set flag in exit status to show that we've "dumped core" */
+	sig |= __WCOREFLAG; /* Set flag in exit status to show that we've "dumped core" */
 
 	/* If core dump size is >1MB, try to invoke dumper to write a
 	   .core file */
diff --git a/winsup/cygwin/include/cygwin/wait.h b/winsup/cygwin/include/cygwin/wait.h
index 7e40c8d6c..0d42e8920 100644
--- a/winsup/cygwin/include/cygwin/wait.h
+++ b/winsup/cygwin/include/cygwin/wait.h
@@ -16,12 +16,13 @@ details. */
 #define WUNTRACED 2
 #define WCONTINUED 8
 #define __W_CONTINUED	0xffff
+#define __WCOREFLAG 0x80
 
 /* A status is 16 bits, and looks like:
       <1 byte info> <1 byte code>
 
       <code> == 0, child has exited, info is the exit value
-      <code> == 1..7e, child has exited, info is the signal number.
+      <code> == 1..7e, child has exited, code is the signal number.
       <code> == 7f, child has stopped, info was the signal number.
       <code> == 80, there was a core dump.
 */
@@ -34,6 +35,6 @@ details. */
 #define WEXITSTATUS(_w)		(((_w) >> 8) & 0xff)
 #define WTERMSIG(_w)		((_w) & 0x7f)
 #define WSTOPSIG		WEXITSTATUS
-#define WCOREDUMP(_w)		(WIFSIGNALED(_w) && ((_w) & 0x80))
+#define WCOREDUMP(_w)		(WIFSIGNALED(_w) && ((_w) & __WCOREFLAG))
 
 #endif /* _CYGWIN_WAIT_H */
-- 
2.43.0


  parent reply	other threads:[~2024-01-12 14:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 14:09 [PATCH 0/5] Coredump under 'ulimit -c' control (v2) Jon Turney
2024-01-12 14:09 ` [PATCH 1/5] Cygwin: Make 'ulimit -c' control writing a coredump Jon Turney
2024-01-13 14:20   ` Jon Turney
2024-01-15  9:46     ` Corinna Vinschen
2024-01-15 13:27       ` Jon Turney
2024-01-15 14:28         ` Corinna Vinschen
2024-01-16 13:52           ` Jon Turney
2024-01-16 13:54             ` Corinna Vinschen
2024-01-23 14:20   ` Jon Turney
2024-01-23 14:29     ` Corinna Vinschen
2024-01-24 13:28       ` Jon Turney
2024-01-24 14:39         ` Corinna Vinschen
2024-01-25 14:50           ` Jon Turney
2024-01-25 18:21             ` Corinna Vinschen
2024-01-25 20:03               ` Jon Turney
2024-01-26 11:12                 ` Corinna Vinschen
2024-01-26 11:52                   ` Corinna Vinschen
2024-01-27 15:12                     ` Jon Turney
2024-01-29 11:16                       ` Corinna Vinschen
2024-01-12 14:09 ` [PATCH 2/5] Cygwin: Disable writing core dumps by default Jon Turney
2024-01-12 14:09 ` Jon Turney [this message]
2024-01-12 14:09 ` [PATCH 4/5] Cygwin: Treat api_fatal() similarly to a core-dumping signal Jon Turney
2024-01-12 14:09 ` [PATCH 5/5] Cygwin: Update documentation for cygwin_stackdump Jon Turney
2024-01-12 18:44   ` Corinna Vinschen
2024-01-13 13:40     ` Jon Turney
2024-01-12 18:41 ` [PATCH 0/5] Coredump under 'ulimit -c' control (v2) Corinna Vinschen

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=20240112140958.1694-4-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-patches@cygwin.com \
    /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).