Tito writes:
authorEric Andersen <andersen@codepoet.org>
Thu, 2 Sep 2004 22:22:17 +0000 (22:22 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 2 Sep 2004 22:22:17 +0000 (22:22 -0000)
The second patch contains:
1) a size optimization for adduser.c
2) removes a warning about an unused variable in syslogd.c if CONFIG_FEATURE_REMOTE_LOG is not set
3)cosmetic fixes for addgroup_full_usage and adduser_full_usage

Ciao,
Tito

include/usage.h
loginutils/adduser.c
sysklogd/syslogd.c

index a0b812a4a6aa5bb24ce682c16accf7eb6a9232f9..f87f367c492c128000f0de4f4a2118c188f9a2cf 100644 (file)
@@ -4,14 +4,14 @@
 #define addgroup_trivial_usage \
        "[-g GID] group_name [user_name]"
 #define addgroup_full_usage \
-       "Adds a group to the system" \
+       "Adds a group to the system\n\n" \
        "Options:\n" \
        "\t-g GID\t\tspecify gid"
 
 #define adduser_trivial_usage \
        "[OPTIONS] user_name"
 #define adduser_full_usage \
-       "Adds a user to the system" \
+       "Adds a user to the system\n\n" \
        "Options:\n" \
        "\t-h DIR\t\tAssign home directory DIR\n" \
        "\t-g GECOS\tAssign gecos field GECOS\n" \
index 76878884587fafa2fcd861c6925acbd2364f109a..7fa05a01340baf8b1bf5a71a51a05fa095ba3d7f 100644 (file)
@@ -305,13 +305,8 @@ int adduser_main(int argc, char **argv)
 
        if (usegroup) {
                /* Add user to a group that already exists */
-               struct group *g;
-
-               g = getgrnam(usegroup);
-               if (g == NULL)
-                       bb_error_msg_and_die("group %s does not exist", usegroup);
-
-               pw.pw_gid = g->gr_gid;
+               pw.pw_gid = my_getgrnam(usegroup);
+               /* exits on error */    
        }
 
        /* grand finale */
index 741c8067344545492409cf8e746ed78026ffe2e5..6e7652c0098042f6ef2625813d9f50ff39fc9c49 100644 (file)
@@ -386,7 +386,9 @@ static void logMessage(int pri, char *msg)
        time_t now;
        char *timestamp;
        static char res[20] = "";
+#ifdef CONFIG_FEATURE_REMOTE_LOG       
        static char line[512];
+#endif
        CODE *c_pri, *c_fac;
 
        if (pri != 0) {