hush: move msh/lash config into hush.c, no code changes
[oweals/busybox.git] / runit / chpst.c
index 21297daf6d5f58099eff6f981c5a15bb26e3d101..ad0811294619b30850e058dab028195c04cf9970 100644 (file)
@@ -92,7 +92,8 @@ enum {
        OPT_2 = (1 << 20) * ENABLE_CHPST,
 };
 
-static void edir(const char *directory_name)
+/* TODO: use recursive_action? */
+static NOINLINE void edir(const char *directory_name)
 {
        int wdir;
        DIR *dir;
@@ -101,9 +102,7 @@ static void edir(const char *directory_name)
 
        wdir = xopen(".", O_RDONLY | O_NDELAY);
        xchdir(directory_name);
-       dir = opendir(".");
-       if (!dir)
-               bb_perror_msg_and_die("opendir %s", directory_name);
+       dir = xopendir(".");
        for (;;) {
                char buf[256];
                char *tail;
@@ -383,6 +382,5 @@ int chpst_main(int argc UNUSED_PARAM, char **argv)
        if (opt & OPT_2)
                close(STDERR_FILENO);
 
-       BB_EXECVP(argv[0], argv);
-       bb_perror_msg_and_die("exec %s", argv[0]);
+       BB_EXECVP_or_die(argv);
 }