Skip to content

Commit b1e72db

Browse files
committed
patch SIGKILL for Windows
1 parent fb9316d commit b1e72db

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

fio-stl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4760,6 +4760,11 @@ Patches for Windows
47604760

47614761

47624762
***************************************************************************** */
4763+
#ifndef SIGKILL
4764+
#ifdef SIGABRT
4765+
#define SIGKILL SIGABRT
4766+
#endif
4767+
#endif
47634768
#if FIO_OS_WIN
47644769

47654770
/* *****************************************************************************
@@ -36945,13 +36950,16 @@ The IO Reactor Cycle (the actual work)
3694536950
static void fio___io_signal_crash(int sig, void *flg) {
3694636951
FIO_LOG_FATAL("(%d) additional stop signal(!) - should crash.", FIO___IO.pid);
3694736952
fio_signal_forget(sig);
36953+
36954+
#ifdef SIGKILL
3694836955
/* cannot lock, signal may be received during critical section */
3694936956
FIO_LIST_EACH(fio___io_pid_s, node, &FIO___IO.pids, pos) {
3695036957
if (!pos->done)
3695136958
fio_thread_kill(pos->pid, SIGKILL);
3695236959
}
3695336960
fio_thread_kill(FIO___IO.root_pid, SIGKILL);
3695436961
fio_thread_kill(FIO___IO.pid, SIGKILL);
36962+
#endif
3695536963
exit(-1);
3695636964
(void)sig, (void)flg;
3695736965
}

fio-stl/001 patches.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ Patches for Windows
4747
4848
4949
***************************************************************************** */
50+
#ifndef SIGKILL
51+
#ifdef SIGABRT
52+
#define SIGKILL SIGABRT
53+
#endif
54+
#endif
5055
#if FIO_OS_WIN
5156

5257
/* *****************************************************************************

fio-stl/402 io reactor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ The IO Reactor Cycle (the actual work)
2222
static void fio___io_signal_crash(int sig, void *flg) {
2323
FIO_LOG_FATAL("(%d) additional stop signal(!) - should crash.", FIO___IO.pid);
2424
fio_signal_forget(sig);
25+
26+
#ifdef SIGKILL
2527
/* cannot lock, signal may be received during critical section */
2628
FIO_LIST_EACH(fio___io_pid_s, node, &FIO___IO.pids, pos) {
2729
if (!pos->done)
2830
fio_thread_kill(pos->pid, SIGKILL);
2931
}
3032
fio_thread_kill(FIO___IO.root_pid, SIGKILL);
3133
fio_thread_kill(FIO___IO.pid, SIGKILL);
34+
#endif
3235
exit(-1);
3336
(void)sig, (void)flg;
3437
}

0 commit comments

Comments
 (0)