libbb: commonalize a bit of little-endian CRC32 table generation code
[oweals/busybox.git] / util-linux / fsfreeze.c
index 70dec24ec582777e7784bf948472cf4c38f6945d..c485810aa02686b306a80c8e18a7057e5ba1810a 100644 (file)
@@ -4,16 +4,15 @@
  *
  * Licensed under GPLv2, see file LICENSE in this source tree.
  */
-
 //config:config FSFREEZE
-//config:      bool "fsfreeze"
+//config:      bool "fsfreeze (3.6 kb)"
 //config:      default y
 //config:      select PLATFORM_LINUX
 //config:      select LONG_OPTS
 //config:      help
-//config:        Halt new accesses and flush writes on a mounted filesystem.
+//config:      Halt new accesses and flush writes on a mounted filesystem.
 
-//applet:IF_FSFREEZE(APPLET(fsfreeze, BB_DIR_USR_SBIN, BB_SUID_DROP))
+//applet:IF_FSFREEZE(APPLET_NOEXEC(fsfreeze, fsfreeze, BB_DIR_USR_SBIN, BB_SUID_DROP, fsfreeze))
 
 //kbuild:lib-$(CONFIG_FSFREEZE) += fsfreeze.o
 
@@ -36,15 +35,15 @@ int fsfreeze_main(int argc UNUSED_PARAM, char **argv)
        unsigned opts;
        int fd;
 
-       applet_long_options =
-               "freeze\0"   No_argument "\xff"
-               "unfreeze\0" No_argument "\xfe"
-       ;
        /* exactly one non-option arg: the mountpoint */
        /* one of opts is required */
        /* opts are mutually exclusive */
-       opt_complementary = "=1:""\xff:\xfe:""\xff--\xfe:\xfe--\xff";
-       opts = getopt32(argv, "");
+       opts = getopt32long(argv, "^"
+               "" /* no opts */
+               "\0" "=1:""\xff:\xfe:""\xff--\xfe:\xfe--\xff",
+               "freeze\0"   No_argument "\xff"
+               "unfreeze\0" No_argument "\xfe"
+       );
 
        fd = xopen(argv[optind], O_RDONLY);
        /* Works with NULL arg on linux-4.8.0 */