build-path: make invoke_callout_binary() honour $PATH as last resort

If we cannot find the callout we need in the build dir let's look for it
in $PATH as last resort.

This makes invoke_callout_binary() usable for all binaries we install
into $PATH (as opposed to /usr/lib/systemd), but has no effect
on callout binaries specified with full path.

This is useful, since we soon want to invoke journalctl as a callout.
This commit is contained in:
Lennart Poettering
2025-03-26 11:15:25 -04:00
committed by Yu Watanabe
parent f5729bbb1e
commit 2caa462504

View File

@@ -241,7 +241,7 @@ int invoke_callout_binary(const char *path, char *const argv[]) {
if (find_build_dir_binary(fn, &np) >= 0)
execv(np, argv);
execv(path, argv);
execvp(path, argv);
return -errno;
}