diff options
Diffstat (limited to 'src/run/run.c')
-rw-r--r-- | src/run/run.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/run/run.c b/src/run/run.c index 93d8cd1d08..6d3e739882 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -30,6 +30,7 @@ #include "calendarspec.h" #include "env-util.h" #include "event-util.h" +#include "fd-util.h" #include "formats-util.h" #include "path-util.h" #include "ptyfwd.h" @@ -1153,14 +1154,20 @@ int main(int argc, char* argv[]) { if (r <= 0) goto finish; - if (argc > optind) { - r = find_binary(argv[optind], arg_transport == BUS_TRANSPORT_LOCAL, &command); + if (argc > optind && arg_transport == BUS_TRANSPORT_LOCAL) { + /* Patch in an absolute path */ + + r = find_binary(argv[optind], &command); if (r < 0) { - log_error_errno(r, "Failed to find executable %s%s: %m", - argv[optind], - arg_transport == BUS_TRANSPORT_LOCAL ? "" : " on local system"); + log_error_errno(r, "Failed to find executable %s: %m", argv[optind]); + goto finish; + } + if (r == 0) { + log_error("Couldn't find executable %s.", argv[optind]); + r = -ENOENT; goto finish; } + argv[optind] = command; } |