]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/import/importd.c
importd: port importd over to new invoke_callout_binary() API
[thirdparty/systemd.git] / src / import / importd.c
index 3321155e84fa19427b07f708f58e6ff531bb5c15..d25c23c6dc5f3ad4d46837f6dfa9b0e9396157f4 100644 (file)
@@ -6,6 +6,7 @@
 #include "sd-bus.h"
 
 #include "alloc-util.h"
+#include "build-path.h"
 #include "bus-common-errors.h"
 #include "bus-get-properties.h"
 #include "bus-log-control-api.h"
@@ -475,8 +476,10 @@ static int transfer_start(Transfer *t) {
                         cmd[k++] = t->local;
                 cmd[k] = NULL;
 
-                execv(cmd[0], (char * const *) cmd);
-                log_error_errno(errno, "Failed to execute %s tool: %m", cmd[0]);
+                assert(k < ELEMENTSOF(cmd));
+
+                r = invoke_callout_binary(cmd[0], (char * const *) cmd);
+                log_error_errno(r, "Failed to execute %s tool: %m", cmd[0]);
                 _exit(EXIT_FAILURE);
         }