projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
First snapshot of FIO for Windows
[fio.git]
/
fio.c
diff --git
a/fio.c
b/fio.c
index 8dff813cc20bab39d7b1ac13d1ca0c80d611440a..2420d1039cd18cf1b99f4c10c6568f61ce42a678 100644
(file)
--- a/
fio.c
+++ b/
fio.c
@@
-101,12
+101,12
@@
static void terminate_threads(int group_id)
* if the thread is running, just let it exit
*/
if (td->runstate < TD_RUNNING)
* if the thread is running, just let it exit
*/
if (td->runstate < TD_RUNNING)
- kill(td->pid, SIG
QUIT
);
+ kill(td->pid, SIG
TERM
);
else {
struct ioengine_ops *ops = td->io_ops;
else {
struct ioengine_ops *ops = td->io_ops;
- if (ops && (ops->flags & FIO_SIG
QUIT
))
- kill(td->pid, SIG
QUIT
);
+ if (ops && (ops->flags & FIO_SIG
TERM
))
+ kill(td->pid, SIG
TERM
);
}
}
}
}
}
}
@@
-161,8
+161,14
@@
static void posix_timer_setup(void)
evt.sigev_notify = SIGEV_THREAD;
evt.sigev_notify_function = ival_fn;
evt.sigev_notify = SIGEV_THREAD;
evt.sigev_notify_function = ival_fn;
+#ifndef __CYGWIN__
if (timer_create(CLOCK_MONOTONIC, &evt, &ival_timer) < 0)
perror("timer_create");
if (timer_create(CLOCK_MONOTONIC, &evt, &ival_timer) < 0)
perror("timer_create");
+#else /* Windows (and thus Cygwin) doesn't have a monotonic clock */
+ if (timer_create(CLOCK_REALTIME, &evt, &ival_timer) < 0)
+ perror("timer_create");
+#endif
+
}
static void set_sig_handlers(void)
}
static void set_sig_handlers(void)
@@
-177,7
+183,7
@@
static void set_sig_handlers(void)
memset(&act, 0, sizeof(act));
act.sa_handler = sig_quit;
act.sa_flags = SA_RESTART;
memset(&act, 0, sizeof(act));
act.sa_handler = sig_quit;
act.sa_flags = SA_RESTART;
- sigaction(SIG
QUIT
, &act, NULL);
+ sigaction(SIG
TERM
, &act, NULL);
}
/*
}
/*
@@
-1352,7
+1358,7
@@
static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
if (WIFSIGNALED(status)) {
int sig = WTERMSIG(status);
if (WIFSIGNALED(status)) {
int sig = WTERMSIG(status);
- if (sig != SIG
QUIT
)
+ if (sig != SIG
TERM
)
log_err("fio: pid=%d, got signal=%d\n",
(int) td->pid, sig);
td_set_runstate(td, TD_REAPED);
log_err("fio: pid=%d, got signal=%d\n",
(int) td->pid, sig);
td_set_runstate(td, TD_REAPED);
@@
-1703,7
+1709,11
@@
int main(int argc, char *argv[])
}
startup_mutex = fio_mutex_init(0);
}
startup_mutex = fio_mutex_init(0);
+ if (startup_mutex == NULL)
+ return 1;
writeout_mutex = fio_mutex_init(1);
writeout_mutex = fio_mutex_init(1);
+ if (writeout_mutex == NULL)
+ return 1;
set_genesis_time();
set_genesis_time();