]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/examples/ioat/verify/verify.c
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / examples / ioat / verify / verify.c
index c344ba82c280a7222bb3933445958bc0d1afd69e..1409ad6a904267026211ea41f51e141c0aab5a5e 100644 (file)
@@ -256,13 +256,13 @@ parse_args(int argc, char **argv)
        while ((op = getopt(argc, argv, "c:ht:q:")) != -1) {
                switch (op) {
                case 't':
-                       g_user_config.time_in_sec = atoi(optarg);
+                       g_user_config.time_in_sec = spdk_strtol(optarg, 10);
                        break;
                case 'c':
                        g_user_config.core_mask = optarg;
                        break;
                case 'q':
-                       g_user_config.queue_depth = atoi(optarg);
+                       g_user_config.queue_depth = spdk_strtol(optarg, 10);
                        break;
                case 'h':
                        usage(argv[0]);
@@ -272,7 +272,8 @@ parse_args(int argc, char **argv)
                        return 1;
                }
        }
-       if (!g_user_config.time_in_sec || !g_user_config.core_mask || !g_user_config.queue_depth) {
+       if (g_user_config.time_in_sec <= 0 || !g_user_config.core_mask ||
+           g_user_config.queue_depth <= 0) {
                usage(argv[0]);
                return 1;
        }