Skip to content

Commit

Permalink
rix ruby32 windows build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
janbiedermann committed Oct 5, 2022
1 parent c35bfc1 commit f5cabf2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions ext/iodine_ext/fio.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ int ioctl (int fd, u_long request, int* argp) {
else { return 0; }
}

int kill(int pid, int sig) {
int fio_kill(int pid, int sig) {
/* Credit to Jan Biedermann (GitHub: @janbiedermann) */
HANDLE handle;
DWORD status;
Expand Down Expand Up @@ -987,7 +987,7 @@ FIO_FUNC void fio_thread_signal(void) {
(void)r;
} else if (fd == -1) {
/* hardly the best way, but there's a thread sleeping on air */
kill(getpid(), SIGCONT);
fio_kill(getpid(), SIGCONT);
}
#endif
}
Expand Down Expand Up @@ -1654,7 +1654,7 @@ void fio_reap_children(void) {
sa.sa_flags = SA_RESTART | SA_NOCLDSTOP;
if (sigaction(SIGCHLD, &sa, &fio_old_sig_chld) == -1) {
perror("Child reaping initialization failed");
kill(0, SIGINT);
fio_kill(0, SIGINT);
exit(errno);
}
}
Expand Down Expand Up @@ -4603,7 +4603,7 @@ static void *fio_sentinel_worker_thread(void *arg) {
if (child == -1) {
FIO_LOG_FATAL("couldn't spawn worker.");
perror("\n errno");
kill(fio_parent_pid(), SIGINT);
fio_kill(fio_parent_pid(), SIGINT);
fio_stop();
return NULL;
} else if (child) {
Expand All @@ -4617,7 +4617,7 @@ static void *fio_sentinel_worker_thread(void *arg) {
} else {
FIO_LOG_FATAL("Child worker (%d) shutdown. Stopping services.", child);
}
kill(0, SIGINT);
fio_kill(0, SIGINT);
}
#else
if (fio_data->active) {
Expand Down Expand Up @@ -6879,7 +6879,7 @@ static void fio_cluster_on_close(intptr_t uuid, fio_protocol_s *pr_) {
#ifndef __MINGW32__
fio_cluster_data_cleanup(1);
#endif
kill(getpid(), SIGINT);
fio_kill(getpid(), SIGINT);
}
}
if (c->msg)
Expand Down Expand Up @@ -7155,7 +7155,7 @@ static void fio_cluster_on_connect(intptr_t uuid, void *udata) {
static void fio_cluster_on_fail(intptr_t uuid, void *udata) {
FIO_LOG_FATAL("(facil.io) unknown cluster connection error");
perror(" errno");
kill(fio_parent_pid(), SIGINT);
fio_kill(fio_parent_pid(), SIGINT);
fio_stop();
// exit(errno ? errno : 1);
(void)udata;
Expand Down
8 changes: 5 additions & 3 deletions ext/iodine_ext/fio.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,12 @@ Version and helper macros
#define pipe(fds) _pipe(fds, 65536, _O_BINARY)

int fork(void);
int kill(int, int);
int fio_kill(int, int);
ssize_t pread(int, void*, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
int fio_osffd4fd(unsigned int);
#else
#define fio_kill kill
#endif

/* *****************************************************************************
Expand Down Expand Up @@ -523,7 +525,7 @@ FIO_LOG2STDERR(const char *format, ...) {
if (!(ptr)) { \
FIO_LOG_FATAL("memory allocation error "__FILE__ \
":" FIO_MACRO2STR(__LINE__)); \
kill(0, SIGINT); \
fio_kill(0, SIGINT); \
exit(errno); \
}
#endif
Expand Down Expand Up @@ -6048,7 +6050,7 @@ FIO_NAME(_insert_or_overwrite_)(FIO_NAME(s) * set, FIO_SET_HASH_TYPE hash_value,
pos->hash = hash_value;
pos->pos->hash = hash_value;
FIO_SET_COPY(pos->pos->obj, obj);

return pos->pos->obj;
}

Expand Down
2 changes: 1 addition & 1 deletion ext/iodine_ext/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ intptr_t http_listen(const char *port, const char *binding,
if (arg_settings.on_request == NULL) {
FIO_LOG_ERROR("http_listen requires the .on_request parameter "
"to be set\n");
kill(0, SIGINT);
fio_kill(0, SIGINT);
exit(11);
}

Expand Down
2 changes: 1 addition & 1 deletion ext/iodine_ext/redis_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ FIO_IGNORE_MACRO(struct redis_engine_create_args args) {
if (getpid() != fio_parent_pid()) {
FIO_LOG_FATAL("(redis) Redis engine initialization can only "
"be performed in the Root process.");
kill(0, SIGINT);
fio_kill(0, SIGINT);
fio_stop();
return NULL;
}
Expand Down

0 comments on commit f5cabf2

Please sign in to comment.