use execvp() not execve() in tincctl start
sometimes argv[0] will have directory-less name (when the command is started by shell searching in $PATH for example). For tincctl start we want the same rules to run tincd as for tincctl itself (having full path is better but if shell does not provide one we've no other choice). Previous code tried to run ./tincd in this case, which is obviously wrong. This is a fix for the previous commit. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
a7556a9d2c
commit
bbc0ba9e87
1 changed files with 2 additions and 2 deletions
|
@ -516,7 +516,7 @@ static bool remove_service(void) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[], char *envp[]) {
|
||||
int main(int argc, char *argv[]) {
|
||||
int fd;
|
||||
int result;
|
||||
char host[128];
|
||||
|
@ -586,7 +586,7 @@ int main(int argc, char *argv[], char *envp[]) {
|
|||
if (i != optind && strcmp(argv[i], "--") != 0)
|
||||
argv[j++] = argv[i];
|
||||
argv[j] = NULL;
|
||||
execve(c, argv, envp);
|
||||
execvp(c, argv);
|
||||
fprintf(stderr, "Could not start %s: %s\n", c, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue