tls: reorder a few more cipher ids
[oweals/busybox.git] / util-linux / script.c
index 62a2417624e4682e3bd96915c36f33963acb8bf6..aac77c3ba78dcba9740bcc31fb0de9402cd5e20a 100644 (file)
@@ -27,7 +27,8 @@
 //usage:     "\n"
 //usage:     "\n       -a      Append output"
 //usage:     "\n       -c PROG Run PROG, not shell"
-//usage:     "\n       -f      Flush output after each write"
+/* Accepted but has no effect (we never buffer output) */
+/*//usage:     "\n     -f      Flush output after each write"*/
 //usage:     "\n       -q      Quiet"
 //usage:     "\n       -t[FILE] Send timing to stderr or FILE"
 
@@ -70,19 +71,19 @@ int script_main(int argc UNUSED_PARAM, char **argv)
        };
 
 #if ENABLE_LONG_OPTS
-       static const char getopt_longopts[] ALIGN1 =
+       static const char script_longopts[] ALIGN1 =
                "append\0"  No_argument       "a"
                "command\0" Required_argument "c"
                "flush\0"   No_argument       "f"
                "quiet\0"   No_argument       "q"
                "timing\0"  Optional_argument "t"
                ;
-
-       applet_long_options = getopt_longopts;
 #endif
 
-       opt_complementary = "?1"; /* max one arg */
-       opt = getopt32(argv, "ac:fqt::", &shell_arg, &str_t);
+       opt = getopt32long(argv, "^" "ac:fqt::" "\0" "?1"/* max one arg */,
+                               script_longopts,
+                               &shell_arg, &str_t
+       );
        //argc -= optind;
        argv += optind;
        if (argv[0]) {
@@ -178,9 +179,10 @@ int script_main(int argc UNUSED_PARAM, char **argv)
                                        }
                                        full_write(STDOUT_FILENO, buf, count);
                                        full_write(outfd, buf, count);
-                                       if (opt & OPT_f) {
-                                               fsync(outfd);
-                                       }
+                                       // If we'd be using (buffered) FILE i/o, we'd need this:
+                                       //if (opt & OPT_f) {
+                                       //      fflush(outfd);
+                                       //}
                                }
                        }
                        if (pfd[1].revents) {