bc: convert to "G trick" - this returns bc to zero bss increase
[oweals/busybox.git] / coreutils / uname.c
index 1f19c933db802abb889194623af79d3144002d95..765809658a1e600b008a0c4303e295f286d3c5ff 100644 (file)
@@ -1,5 +1,6 @@
 /* vi: set sw=4 ts=4: */
-/* uname -- print system information
+/*
+ * uname -- print system information
  * Copyright (C) 1989-1999 Free Software Foundation, Inc.
  *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  *  Fix handling of -a to not print "unknown", add -o and -i support.
  */
 //config:config UNAME
-//config:      bool "uname"
+//config:      bool "uname (3.7 kb)"
 //config:      default y
 //config:      help
-//config:        uname is used to print system information.
+//config:      uname is used to print system information.
 //config:
 //config:config UNAME_OSNAME
 //config:      string "Operating system name"
 //config:      default "GNU/Linux"
 //config:      depends on UNAME
 //config:      help
-//config:        Sets the operating system name reported by uname -o.  The
-//config:        default is "GNU/Linux".
+//config:      Sets the operating system name reported by uname -o.  The
+//config:      default is "GNU/Linux".
 //config:
 //can't use "ARCH" for this applet, all hell breaks loose in build system :)
 //config:config BB_ARCH
-//config:      bool "arch"
+//config:      bool "arch (1.6 kb)"
 //config:      default y
 //config:      help
-//config:        Same as uname -m.
+//config:      Same as uname -m.
 
-//applet:IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP))
-//                  APPLET_ODDNAME:name  main   location    suid_type     help
-//applet:IF_BB_ARCH(APPLET_ODDNAME(arch, uname, BB_DIR_BIN, BB_SUID_DROP, arch))
+//                  APPLET_NOFORK:name   main   location    suid_type     help
+//applet:IF_UNAME(APPLET_NOFORK(  uname, uname, BB_DIR_BIN, BB_SUID_DROP, uname))
+//applet:IF_BB_ARCH(APPLET_NOFORK(arch,  uname, BB_DIR_BIN, BB_SUID_DROP, arch))
 
 //kbuild:lib-$(CONFIG_UNAME)   += uname.o
 //kbuild:lib-$(CONFIG_BB_ARCH) += uname.o
@@ -126,11 +127,9 @@ int uname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
 {
        uname_info_t uname_info;
        IF_UNAME(const char *unknown_str = "unknown";)
-       unsigned toprint;
-
-       toprint = (1 << 4); /* "arch" = "uname -m" */
-
 #if ENABLE_UNAME
+       unsigned toprint = (1 << 4); /* "arch" = "uname -m" */
+
        if (!ENABLE_BB_ARCH || applet_name[0] == 'u') {
 # if ENABLE_LONG_OPTS
                static const char uname_longopts[] ALIGN1 =
@@ -147,8 +146,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
                        "operating-system\0"  No_argument       "o"
                ;
 # endif
-               IF_LONG_OPTS(applet_long_options = uname_longopts);
-               toprint = getopt32(argv, options);
+               toprint = getopt32long(argv, options, uname_longopts);
                if (argv[optind]) { /* coreutils-6.9 compat */
                        bb_show_usage();
                }
@@ -183,7 +181,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
                strcpy(uname_info.processor, unknown_str);
                strcpy(uname_info.platform, unknown_str);
                strcpy(uname_info.os, CONFIG_UNAME_OSNAME);
-# if 0
+# if ENABLE_FEDORA_COMPAT
                /* Fedora does something like this */
                strcpy(uname_info.processor, uname_info.name.machine);
                strcpy(uname_info.platform, uname_info.name.machine);