]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/run_part: Unify error messages
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 13 Sep 2024 22:14:20 +0000 (00:14 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Wed, 18 Sep 2024 12:52:05 +0000 (14:52 +0200)
At least if they can be assigned directly to a function call.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
lib/run_part.c

index c5d4bd9e9fb44142b5a19b9a2962b32a33b9946c..d848d2f4b3cad7c904a7669627979bc9fa188886 100644 (file)
@@ -24,7 +24,7 @@ static int run_part (char *script_path, const char *name, const char *action)
 
        pid=fork();
        if (pid==-1) {
-               fprintf (shadow_logfd, "Could not fork: %s\n", strerror(errno));
+               fprintf (shadow_logfd, "fork: %s\n", strerror(errno));
                return 1;
        }
        if (pid==0) {
@@ -61,7 +61,7 @@ int run_parts (const char *directory, const char *name, const char *action)
                struct stat  sb;
 
                if (asprintf(&s, "%s/%s", directory, namelist[n]->d_name) == -1) {
-                       fprintf (shadow_logfd, "could not allocate memory\n");
+                       fprintf (shadow_logfd, "asprintf: %s\n", strerror(errno));
                        for (; n<scanlist; n++) {
                                free(namelist[n]);
                        }