Update internal.h to conditionally include asm/string.h
[oweals/busybox.git] / id.c
diff --git a/id.c b/id.c
index 8ded0e521c4e3cba24caa16a647799deba27c8c9..69dfe2658c855a5ef7c0be767ca5c3d64b6b90bd 100644 (file)
--- a/id.c
+++ b/id.c
 #include <sys/types.h>
 
 static const char id_usage[] =
-       "id [OPTIONS]... [USERNAME]\n\n"
-       "Print information for USERNAME or the current user\n\n"
+       "id [OPTIONS]... [USERNAME]\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+       "\nPrint information for USERNAME or the current user\n\n"
+       "Options:\n"
        "\t-g\tprints only the group ID\n"
        "\t-u\tprints only the user ID\n"
-       "\t-r\tprints the real user ID instead of the effective ID (with -ug)\n\n";
+       "\t-r\tprints the real user ID instead of the effective ID (with -ug)\n\n"
+#endif
+       ;
 
 extern int id_main(int argc, char **argv)
 {
        int no_user = 0, no_group = 0, print_real = 0;
        char *cp, *user, *group;
-       gid_t gid;
+       unsigned long gid;
        
        cp = user = group = NULL;
 
@@ -78,14 +82,14 @@ extern int id_main(int argc, char **argv)
                my_getgrgid(group, gid);
        }
 
-       if (no_group) printf("%u\n", my_getpwnam(user));
-       else if (no_user) printf("%u\n", my_getgrnam(group));
+       if (no_group) printf("%lu\n", my_getpwnam(user));
+       else if (no_user) printf("%lu\n", my_getgrnam(group));
        else
-               printf("uid=%u(%s) gid=%u(%s)\n",
+               printf("uid=%lu(%s) gid=%lu(%s)\n",
                           my_getpwnam(user), user, my_getgrnam(group), group);
        
 
-       exit(0);
+       return(0);
 }