Skip to content

Commit

Permalink
fix dependency in state logging + fix child double signaling.
Browse files Browse the repository at this point in the history
  • Loading branch information
boazsegev committed Feb 4, 2025
1 parent f41d017 commit 0c115a4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions fio-stl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11705,7 +11705,7 @@ SFUNC void fio_state_callback_force(fio_state_event_type_e e) {
}

FIO_LOG_DEBUG2("(%d) scheduling %s callbacks (%zu tasks).",
(int)(fio_thread_getpid()),
(int)(fio_getpid()),
FIO___STATE_TASKS_NAMES[e],
(size_t)FIO___STATE_TASKS_ARRAY[e].count);
if (!FIO___STATE_TASKS_ARRAY[e].count)
Expand Down Expand Up @@ -36969,7 +36969,8 @@ static void fio___io_signal_crash(int sig, void *flg) {
static void fio___io_signal_stop(int sig, void *flg) {
FIO_LOG_INFO("(%d) stop signal detected.", FIO___IO.pid);
fio_io_stop();
fio_signal_monitor(sig, fio___io_signal_crash, flg, 0);
if (fio_io_is_master())
fio_signal_monitor(sig, fio___io_signal_crash, flg, 0);
(void)sig, (void)flg;
}

Expand Down
2 changes: 1 addition & 1 deletion fio-stl/004 state callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ SFUNC void fio_state_callback_force(fio_state_event_type_e e) {
}

FIO_LOG_DEBUG2("(%d) scheduling %s callbacks (%zu tasks).",
(int)(fio_thread_getpid()),
(int)(fio_getpid()),
FIO___STATE_TASKS_NAMES[e],
(size_t)FIO___STATE_TASKS_ARRAY[e].count);
if (!FIO___STATE_TASKS_ARRAY[e].count)
Expand Down
3 changes: 2 additions & 1 deletion fio-stl/402 io reactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ static void fio___io_signal_crash(int sig, void *flg) {
static void fio___io_signal_stop(int sig, void *flg) {
FIO_LOG_INFO("(%d) stop signal detected.", FIO___IO.pid);
fio_io_stop();
fio_signal_monitor(sig, fio___io_signal_crash, flg, 0);
if (fio_io_is_master())
fio_signal_monitor(sig, fio___io_signal_crash, flg, 0);
(void)sig, (void)flg;
}

Expand Down
7 changes: 7 additions & 0 deletions tests/url.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#define FIO_URL
#define FIO_STR
#include "fio-stl.h"

int main(int argc, char const *argv[]) {
char *to_parse =
(char *)"http://anon:[email protected]:443/my/path?answer=42#target";
if (argc >= 2)
to_parse = (char *)argv[1];
FIO_STR_INFO_TMP_VAR(path, 1024);
fio_url_s u = fio_url_parse(to_parse, strlen(to_parse));
fprintf(stderr,
"Parsed URL:\n"
Expand Down Expand Up @@ -43,5 +45,10 @@ int main(int argc, char const *argv[]) {
i.value.buf);
}
}
if (u.path.len < 1024) {
fio_string_write_url_dec(&path, NULL, u.path.buf, u.path.len);
if (!FIO_STR_INFO_IS_EQ(path, u.path))
printf("\tdecoded path:\t%s\n", path.buf);
}
return 0;
}

0 comments on commit 0c115a4

Please sign in to comment.