summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-06-04 19:57:47 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-06-04 19:57:47 +0200
commitda28353c3fb45a8a6ee00d1133efd483c0ae684c (patch)
treeadcd5d4d3a15a5e0852bfc7f175a1355c51f0473
parentf022ddb71f93b5d9e32261491284b9881fceaf0c (diff)
downloadfio-da28353c3fb45a8a6ee00d1133efd483c0ae684c.tar.gz
fio-da28353c3fb45a8a6ee00d1133efd483c0ae684c.tar.bz2
Compile warning for non-signal driven solaris asynch io
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--engines/solarisaio.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/engines/solarisaio.c b/engines/solarisaio.c
index dfaa375a..d499f574 100644
--- a/engines/solarisaio.c
+++ b/engines/solarisaio.c
@@ -74,11 +74,6 @@ static void wait_for_event(struct timeval *tv)
sd->nr--;
}
-static void fio_solarisaio_sigio(int sig)
-{
- wait_for_event(NULL);
-}
-
static int fio_solarisaio_getevents(struct thread_data *td, unsigned int min,
unsigned int max, struct timespec *t)
{
@@ -164,17 +159,22 @@ static void fio_solarisaio_cleanup(struct thread_data *td)
/*
* Set USE_SIGNAL_COMPLETIONS to use SIGIO as completion events.
*/
+#ifdef USE_SIGNAL_COMPLETIONS
+static void fio_solarisaio_sigio(int sig)
+{
+ wait_for_event(NULL);
+}
+
static void fio_solarisaio_init_sigio(void)
{
-#ifdef USE_SIGNAL_COMPLETIONS
struct sigaction act;
memset(&act, 0, sizeof(act));
act.sa_handler = fio_solarisaio_sigio;
act.sa_flags = SA_RESTART;
sigaction(SIGIO, &act, NULL);
-#endif
}
+#endif
static int fio_solarisaio_init(struct thread_data *td)
{
@@ -193,7 +193,9 @@ static int fio_solarisaio_init(struct thread_data *td)
memset(sd->aio_events, 0, max_depth * sizeof(struct io_u *));
sd->max_depth = max_depth;
+#ifdef USE_SIGNAL_COMPLETIONS
fio_solarisaio_init_sigio();
+#endif
td->io_ops->data = sd;
return 0;