lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / coreutils / uname.c
index 4c3bf2f3bb4ce18fb35929039837fd303cb63f46..d1c50e222f4572cc5cd460f6d7d8091832b8d62e 100644 (file)
@@ -2,7 +2,7 @@
 /* uname -- print system information
  * Copyright (C) 1989-1999 Free Software Foundation, Inc.
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 /* BB_AUDIT SUSv3 compliant */
@@ -48,8 +48,9 @@
  *  Fix handling of -a to not print "unknown", add -o and -i support.
  */
 
-#include <sys/utsname.h>
 #include "libbb.h"
+/* After libbb.h, since it needs sys/types.h on some systems */
+#include <sys/utsname.h>
 
 typedef struct {
        struct utsname name;
@@ -73,8 +74,8 @@ static const unsigned short utsname_offset[] = {
 int uname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int uname_main(int argc UNUSED_PARAM, char **argv)
 {
-#if ENABLE_FEATURE_UNEXPAND_LONG_OPTIONS
-       static const char longopts[] ALIGN1 =
+#if ENABLE_LONG_OPTS
+       static const char uname_longopts[] ALIGN1 =
                /* name, has_arg, val */
                "all\0"               No_argument       "a"
                "kernel-name\0"       No_argument       "s"
@@ -97,7 +98,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv)
        const unsigned short *delta;
        unsigned toprint;
 
-       USE_FEATURE_UNEXPAND_LONG_OPTIONS(applet_long_options = longopts);
+       IF_LONG_OPTS(applet_long_options = uname_longopts);
        toprint = getopt32(argv, options);
 
        if (argv[optind]) { /* coreutils-6.9 compat */