Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix incompatible function pointer types issue #1263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion util/events/libuv/Process.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
#include "util/Bits.h"
#include "util/Identity.h"

void Process_OnExitCallbackWrapper(long pid, int exitCode) {
long long pidLongLong = (long long) pid;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be casted to an int64_t because that is not guaranteed to be a long long. On 64 bit machines it is usually a long and I believe on some machines it is possible that long long is uint128_t.

Process_OnExitCallback(pidLongLong, exitCode);
}

int Process_spawn(char* binaryPath,
char** args,
struct Allocator* alloc,
Expand All @@ -26,7 +31,7 @@ int Process_spawn(char* binaryPath,
int i;
for (i = 0; args[i]; i++) ;

return Rffi_spawn(binaryPath, args, i, alloc, callback);
return Rffi_spawn(binaryPath, args, i, alloc, Process_OnExitCallbackWrapper);
}

char* Process_getPath(struct Allocator* alloc)
Expand Down