From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id C218D385828A; Tue, 16 Jan 2024 14:11:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C218D385828A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705414309; bh=eU01eaU033YAAdeSwuXB38lNv4a14l0EqheLgPBWDtk=; h=From:To:Subject:Date:From; b=AjfXJGowUMRfzGUWoY4zCLrizbFkBRZbsjZUQRdbiP/YCrgQmpDW9rX5RnnjWAT+/ IGW3vlIOU7faHZi0DK1FM32uoYlYuidQNv1bUM4P8nYcfzPDSXSrNoXQCXCgD4DvcK lLMX+TlLFx+RRwzSJnYtC0SjcHdCQCcTgi9qUbkw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon Turney To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: Define and use __WCOREFLAG X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/main X-Git-Oldrev: b7868e74103541f3271a170fe3bc2b19a00cc8cf X-Git-Newrev: a83b93e662b0e65fd181ed50de7e960b311f4a94 Message-Id: <20240116141149.C218D385828A@sourceware.org> Date: Tue, 16 Jan 2024 14:11:49 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Da83b93e662b= 0e65fd181ed50de7e960b311f4a94 commit a83b93e662b0e65fd181ed50de7e960b311f4a94 Author: Jon Turney Date: Wed Jan 10 20:35:49 2024 +0000 Cygwin: Define and use __WCOREFLAG =20 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 =3D=3D 0Ul) break; =20 - sig |=3D 0x80; /* Set flag in exit status to show that we've "dumped core= " */ + sig |=3D __WCOREFLAG; /* Set flag in exit status to show that we've "dump= ed core" */ =20 /* 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/cy= gwin/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 =20 /* A status is 16 bits, and looks like: <1 byte info> <1 byte code> =20 =3D=3D 0, child has exited, info is the exit value - =3D=3D 1..7e, child has exited, info is the signal number. + =3D=3D 1..7e, child has exited, code is the signal number. =3D=3D 7f, child has stopped, info was the signal number. =3D=3D 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)) =20 #endif /* _CYGWIN_WAIT_H */