vlib: fix restart cli command 82/42782/2
authorBenoît Ganne <[email protected]>
Thu, 10 Apr 2025 14:19:25 +0000 (16:19 +0200)
committerDamjan Marion <[email protected]>
Sun, 13 Apr 2025 19:04:34 +0000 (19:04 +0000)
Type: fix

Change-Id: I961a261a647863936021e4b29d406971fd76c0af
Signed-off-by: Benoît Ganne <[email protected]>
src/vlib/cli.c

index 4198b4b..d6a9629 100644 (file)
@@ -1239,7 +1239,8 @@ restart_cmd_fn (vlib_main_t * vm, unformat_input_t * input,
     }
 
   /* Exec ourself */
-  execve (vgm->name, (char **) vgm->argv, environ);
+  if (execve ((void *) vgm->argv[0], (char **) vgm->argv, environ))
+    return clib_error_return_unix (0, "execve failed");
 
   return 0;
 }