verify: allow empty/no trigger file
authorJens Axboe <axboe@fb.com>
Wed, 19 Nov 2014 02:16:06 +0000 (19:16 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 19 Nov 2014 02:16:06 +0000 (19:16 -0700)
If we use a trigger timeout, we don't need the file.

Signed-off-by: Jens Axboe <axboe@fb.com>
init.c

diff --git a/init.c b/init.c
index c7fdcddccd45b110288d13040b3da357d999e062..108f2b88d1ae611f20308f8c09a8d41f7b61e5b2 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2212,8 +2212,10 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                        }
 
                        sz = split - optarg;
                        }
 
                        sz = split - optarg;
-                       trigger_file = calloc(1, sz + 1);
-                       strncpy(trigger_file, optarg, sz);
+                       if (sz) {
+                               trigger_file = calloc(1, sz + 1);
+                               strncpy(trigger_file, optarg, sz);
+                       }
 
                        split++;
                        cmd = trigger_cmd = strdup(split);
 
                        split++;
                        cmd = trigger_cmd = strdup(split);