]> git.ozlabs.org Git - petitboot/blobdiff - lib/system/system.c
lib/process: replace pb_run_cmd_pipe
[petitboot] / lib / system / system.c
index d77159d5a7b882470648c740aa301b0314fd67c6..ff4ae991221a9db0630a446194bbaed5f5cef3ab 100644 (file)
 #include "system.h"
 
 const struct pb_system_apps pb_system_apps = {
-       .prefix = PREFIX,
-       .cp = "/bin/cp",
-       .kexec = "/sbin/kexec",
-       .mount = "/bin/mount",
-       .shutdown = "/sbin/shutdown",
-       .sftp = "/usr/bin/sftp",
-       .tftp = "/usr/bin/tftp",
-       .umount = "/bin/umount",
-       .wget = "/usr/bin/wget",
+       .prefix         = PREFIX,
+       .cp             = HOST_PROG_CP,
+       .kexec          = HOST_PROG_KEXEC,
+       .mount          = HOST_PROG_MOUNT,
+       .shutdown       = HOST_PROG_SHUTDOWN,
+       .sftp           = HOST_PROG_SFTP,
+       .tftp           = HOST_PROG_TFTP,
+       .umount         = HOST_PROG_UMOUNT,
+       .wget           = HOST_PROG_WGET,
+       .ip             = HOST_PROG_IP,
+       .udhcpc         = HOST_PROG_UDHCPC,
 };
 
 int pb_mkdir_recursive(const char *dir)
@@ -106,7 +108,6 @@ int pb_rmdir_recursive(const char *base, const char *dir)
  * @wait: Wait for the child process to complete before returning.
  * @dry_run: Don't actually fork and exec.
  */
-
 int pb_run_cmd(const char *const *cmd_argv, int wait, int dry_run)
 {
 #if defined(DEBUG)
@@ -141,6 +142,7 @@ int pb_run_cmd(const char *const *cmd_argv, int wait, int dry_run)
                return -1;
        }
 
+
        if (pid == 0) {
                int log = fileno(pb_log_get_stream());
 
@@ -148,7 +150,6 @@ int pb_run_cmd(const char *const *cmd_argv, int wait, int dry_run)
 
                status = dup2(log, STDOUT_FILENO);
                assert(status != -1);
-
                status = dup2(log, STDERR_FILENO);
                assert(status != -1);