mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
subd: pass absolute path as argv[0].
This means we print out the correct path with --debugger, which can be vital if there are multiple binaries (eg. compiled vs installed). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1950583612
commit
c66df31674
@ -154,6 +154,7 @@ static int subd(const char *dir, const char *name, const char *debug_subdaemon,
|
||||
int fdnum = 3, i;
|
||||
long max;
|
||||
const char *debug_arg[2] = { NULL, NULL };
|
||||
const char *path;
|
||||
|
||||
close(childmsg[0]);
|
||||
close(execfail[0]);
|
||||
@ -194,7 +195,8 @@ static int subd(const char *dir, const char *name, const char *debug_subdaemon,
|
||||
if (debug_subdaemon && strends(name, debug_subdaemon))
|
||||
debug_arg[debug_arg[0] ? 1 : 0] = "--debugger";
|
||||
#endif
|
||||
execl(path_join(NULL, dir, name), name, debug_arg[0], debug_arg[1], NULL);
|
||||
path = path_join(NULL, dir, name);
|
||||
execl(path, path, debug_arg[0], debug_arg[1], NULL);
|
||||
|
||||
child_errno_fail:
|
||||
err = errno;
|
||||
|
Loading…
Reference in New Issue
Block a user