Skip to content

Commit

Permalink
smp: Simplify passing argv
Browse files Browse the repository at this point in the history
  • Loading branch information
sthibaul committed Dec 9, 2024
1 parent 6db346c commit 85d59af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sutils/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ smp (char * const argv[])
mach_port_deallocate (mach_task_self (), _hurd_host_priv);
setuid (getuid ());

execve (argv[1], &argv[1], environ);
execve (argv[0], argv, environ);

/* Fall through if not executed */
error (1, errno, "failed to execute %s", argv[1]);
error (1, errno, "failed to execute %s", argv[0]);
}

int
Expand All @@ -75,6 +75,6 @@ main (int argc, char **argv)
if (argc < 2)
error (1, 0, "Usage: smp /path/to/executable");

smp (argv);
smp (argv + 1);
return 0;
}

0 comments on commit 85d59af

Please sign in to comment.