mirror of https://github.com/sheumann/hush.git
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>
|
||||
#endif
|
||||
#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 <sys/param.h>
|
||||
#include <pwd.h>
|
||||
|
|
Loading…
Reference in New Issue