Skip to content

Commit f1292b0

Browse files
committed
fix(build): use native Windows pid APIs
1 parent fe15a63 commit f1292b0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/adapters/platform/runtime_platform.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void cjit_platform_setup_runtime(CJITState *cjit)
6262
/**
6363
* Writes the process id file used by the file watcher integration.
6464
*/
65-
static int write_pid_file(CJITState *cjit, pid_t pid)
65+
static int write_pid_file(CJITState *cjit, long pid)
6666
{
6767
FILE *fd;
6868

@@ -77,7 +77,7 @@ static int write_pid_file(CJITState *cjit, pid_t pid)
7777
return -1;
7878
}
7979

80-
fprintf(fd, "%d\n", pid);
80+
fprintf(fd, "%ld\n", pid);
8181
fclose(fd);
8282
return 0;
8383
}
@@ -86,7 +86,7 @@ int cjit_platform_exec(CJITState *cjit, int (*entrypoint)(int, char **),
8686
int argc, char **argv)
8787
{
8888
#if defined(WINDOWS)
89-
if (write_pid_file(cjit, getpid()) < 0) {
89+
if (write_pid_file(cjit, (long)GetCurrentProcessId()) < 0) {
9090
return -1;
9191
}
9292
cjit->done_exec = true;
@@ -102,7 +102,7 @@ int cjit_platform_exec(CJITState *cjit, int (*entrypoint)(int, char **),
102102
exit(res);
103103
}
104104

105-
if (write_pid_file(cjit, pid) < 0) {
105+
if (write_pid_file(cjit, (long)pid) < 0) {
106106
return -1;
107107
}
108108

0 commit comments

Comments
 (0)