add missing WIFCONTINUED macro and improve WIFSIGNALED

This commit is contained in:
Rich Felker 2011-02-19 02:23:29 -05:00
parent b386d81862
commit f3ef7a6124
2 changed files with 4 additions and 2 deletions

View File

@ -5,5 +5,6 @@
#define WCOREDUMP(s) ((s) & 0x80)
#define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) (((s) & 0xff) == 0x7f)
#define WIFSIGNALED(s) (!WIFSTOPPED(s) && !WIFEXITED(s))
#define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0)
#define WIFCONTINUED(s) ((s) == 0xffff)
#endif

View File

@ -5,5 +5,6 @@
#define WCOREDUMP(s) ((s) & 0x80)
#define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) (((s) & 0xff) == 0x7f)
#define WIFSIGNALED(s) (!WIFSTOPPED(s) && !WIFEXITED(s))
#define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0)
#define WIFCONTINUED(s) ((s) == 0xffff)
#endif