mirror of
https://github.com/sheumann/hush.git
synced 2024-06-13 02:29:53 +00:00
Properly report exit status values with the high bit set (128-255).
These were being reported as strange values because the WEXITSTATUS macro from the GNO headers would erroneously sign-extend them. Thanks to Kelvin Sherlock for posting an example that demonstrated this problem.
This commit is contained in:
parent
ba87092078
commit
b1044cfa8f
|
@ -62,6 +62,11 @@
|
||||||
# include <sys/sysmacros.h>
|
# include <sys/sysmacros.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#ifdef __GNO__
|
||||||
|
/* Fix definition of WEXITSTATUS to support values with the high bit set. */
|
||||||
|
# undef WEXITSTATUS
|
||||||
|
# define WEXITSTATUS(x) (((*(int *)&(x)) >> 8) & 0xFF)
|
||||||
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user