SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / tests / regression / tools / health / health_check.c
index fbf45c81329bba7161e7cc8bcd3dc83c135ee3dd..deeab67b91b5c07fa698cb65c885261ebc7d4e01 100644 (file)
@@ -1,18 +1,9 @@
 /*
- * Copyright (C) 2012 - Christian Babeux <christian.babeux@efficios.com>
+ * Copyright (C) 2012 Christian Babeux <christian.babeux@efficios.com>
+ * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License, version 2 only, as
- * published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <stdio.h>
@@ -137,14 +128,12 @@ int main(int argc, char *argv[])
        int status = 0, i;
 
        for (i = 1; i < argc; i++) {
-               if (!strcmp(argv[i], "--relayd-path")) {
-                       if (i >= argc - 1) {
-                               fprintf(stderr, "Missing relayd path\n");
-                               exit(EXIT_FAILURE);
-                       }
-                       relayd_path = argv[++i];
+               size_t relayd_path_arg_len = strlen("--relayd-path=");
+               if (!strncmp(argv[i], "--relayd-path=",
+                               relayd_path_arg_len)) {
+                       relayd_path = &argv[i][relayd_path_arg_len];
                } else {
-                       fprintf(stderr, "Unknown option \"%s\". Try --relayd-path PATH.\n", argv[i]);
+                       fprintf(stderr, "Unknown option \"%s\". Try --relayd-path=PATH.\n", argv[i]);
                        exit(EXIT_FAILURE);
                }
        }
This page took 0.024762 seconds and 5 git commands to generate.