public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon Turney <jturney@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/main] Cygwin: Define and use __WCOREFLAG
Date: Tue, 16 Jan 2024 14:11:49 +0000 (GMT)	[thread overview]
Message-ID: <20240116141149.C218D385828A@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a83b93e662b0e65fd181ed50de7e960b311f4a94

commit a83b93e662b0e65fd181ed50de7e960b311f4a94
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Wed Jan 10 20:35:49 2024 +0000

    Cygwin: Define and use __WCOREFLAG
    
    Also fix a typo in description of exit status

Diff:
---
 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 36f6a476a..362ad69a5 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 */

                 reply	other threads:[~2024-01-16 14: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=20240116141149.C218D385828A@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-cvs@sourceware.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).