summaryrefslogtreecommitdiff
path: root/src/run/run.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-10-25 14:22:43 +0100
committerTom Gundersen <teg@jklm.no>2015-10-25 14:22:43 +0100
commit7c8871d31510865e40c8628ef765996202a3cc00 (patch)
tree622b7aa085999fe3d2908772ff0d0c6ec5bf4400 /src/run/run.c
parent7c257428969aaba2acc4e26753c86d6f4774354a (diff)
parentf00022dd121c73b543ae667ddce9814bd67a1b73 (diff)
Merge pull request #1654 from poettering/util-lib
Various changes to src/basic/
Diffstat (limited to 'src/run/run.c')
-rw-r--r--src/run/run.c17
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;
}