]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/test/event/reactor/reactor.c
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / test / event / reactor / reactor.c
index d79f94baa77f784a221682cac6164a3efeb283af..260ba5a02310cbd2ae9b004f03953b1de34292c8 100644 (file)
@@ -34,6 +34,7 @@
 #include "spdk/stdinc.h"
 
 #include "spdk/event.h"
+#include "spdk/string.h"
 #include "spdk/thread.h"
 
 static int g_time_in_sec;
@@ -84,7 +85,7 @@ nop(void *arg)
 }
 
 static void
-test_start(void *arg1, void *arg2)
+test_start(void *arg1)
 {
        printf("test_start\n");
 
@@ -116,14 +117,13 @@ main(int argc, char **argv)
 
        spdk_app_opts_init(&opts);
        opts.name = "reactor";
-       opts.max_delay_us = 1000;
 
        g_time_in_sec = 0;
 
        while ((op = getopt(argc, argv, "t:")) != -1) {
                switch (op) {
                case 't':
-                       g_time_in_sec = atoi(optarg);
+                       g_time_in_sec = spdk_strtol(optarg, 10);
                        break;
                default:
                        usage(argv[0]);
@@ -131,12 +131,12 @@ main(int argc, char **argv)
                }
        }
 
-       if (!g_time_in_sec) {
+       if (g_time_in_sec <= 0) {
                usage(argv[0]);
                exit(1);
        }
 
-       rc = spdk_app_start(&opts, test_start, NULL, NULL);
+       rc = spdk_app_start(&opts, test_start, NULL);
 
        spdk_app_fini();