Cleanup patch from Shaun Jackman converting %m to perror.
authorRob Landley <rob@landley.net>
Tue, 20 Jun 2006 21:35:26 +0000 (21:35 -0000)
committerRob Landley <rob@landley.net>
Tue, 20 Jun 2006 21:35:26 +0000 (21:35 -0000)
shell/hush.c
shell/lash.c

index e3707380da6363c1eaa812e70a46a0f0718576c9..1f4e2e83338540db6bb285dc6e58ca31ccf54f24 100644 (file)
@@ -665,7 +665,7 @@ static int builtin_read(struct child_prog *child)
                } else
                        res = -1;
                if (res)
-                       fprintf(stderr, "read: %m\n");
+                       bb_perror_msg("read");
                free(var);      /* So not move up to avoid breaking errno */
                return res;
        } else {
index 27eb8ec290eb0c8e8baed55bdb1505964f6c2b9c..a209348347d4a5e120c48d0c7d00fad1051fb442 100644 (file)
@@ -228,7 +228,7 @@ static int builtin_cd(struct child_prog *child)
        else
                newdir = child->argv[1];
        if (chdir(newdir)) {
-               printf("cd: %s: %m\n", newdir);
+               bb_perror_msg("cd: %s", newdir);
                return EXIT_FAILURE;
        }
        cwd = xgetcwd((char *)cwd);
@@ -378,7 +378,7 @@ static int builtin_export(struct child_prog *child)
        }
        res = putenv(v);
        if (res)
-               fprintf(stderr, "export: %m\n");
+               bb_perror_msg("export");
 #ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
        if (strncmp(v, "PS1=", 4)==0)
                PS1 = getenv("PS1");
@@ -420,7 +420,7 @@ static int builtin_read(struct child_prog *child)
                if((s = strdup(string)))
                        res = putenv(s);
                if (res)
-                       fprintf(stderr, "read: %m\n");
+                       bb_perror_msg("read");
        }
        else
                fgets(string, sizeof(string), stdin);
@@ -1231,7 +1231,7 @@ static int pseudo_exec(struct child_prog *child)
 
        /* Do not use bb_perror_msg_and_die() here, since we must not
         * call exit() but should call _exit() instead */
-       fprintf(stderr, "%s: %m\n", child->argv[0]);
+       bb_perror_msg("%s", child->argv[0]);
        _exit(EXIT_FAILURE);
 }