Skip to content

Commit

Permalink
Fix windows and wasm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed Aug 8, 2024
1 parent fc8d6a9 commit e387de7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libr/util/sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,16 @@ R_API bool r_sandbox_enable(bool e) {
}

static inline int bytify(int v) {
#if R2__WINDOWS__ || __wasi__
// on windows, there are no WEXITSTATUS, the return value is right there
unsigned int uv = (unsigned int)v;
return (int) ((uv > 255)? 1: 0);
#else
// on unix, return code is (system() >> 8) & 0xff
if (v == -1 || WIFEXITED (v)) {
return WEXITSTATUS (v);
}
#endif
return 1;
}

Expand Down

0 comments on commit e387de7

Please sign in to comment.