X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=beos%2Fbeos.c;h=7e799caf54662539e7e88e009cba4dad37db1fbb;hb=5355f3c7126474078b6e199097ac1d1343f2fdb1;hp=ca562039ca9a90c3779bf7be563a5fc2f5a68786;hpb=30410c71a1b43e0c20155ea024aba695beef72dd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/beos/beos.c b/beos/beos.c index ca56203..7e799ca 100644 --- a/beos/beos.c +++ b/beos/beos.c @@ -1,18 +1,20 @@ -#include "beosish.h" +#include "beos/beosish.h" #undef waitpid #include /* In BeOS 5.0 the waitpid() seems to misbehave in that the status - * is _not_ shifted left by eight (multiplied by 256), as it is in - * POSIX/UNIX. To undo the surpise effect to the rest of Perl we - * need this wrapper. (The rest of BeOS might be surprised because - * of this, though.) */ + * has the upper and lower bytes swapped compared with the usual + * POSIX/UNIX implementations. To undo the surpise effect to the + * rest of Perl we need this wrapper. (The rest of BeOS might be + * surprised because of this, though.) */ pid_t beos_waitpid(pid_t process_id, int *status_location, int options) { pid_t got = waitpid(process_id, status_location, options); if (status_location) - *status_location <<= 8; /* What about the POSIX low bits? */ + *status_location = + (*status_location & 0x00FF) << 8 | + (*status_location & 0xFF00) >> 8; return got; }