claenups for previous commit
[oweals/busybox.git] / procps / fuser.c
index 2cda0f9d7914f53aef1fa7ad8649cb9d15ea9ea0..418f57b579613fe629c17150e7a4d9d1606c4ef7 100644 (file)
@@ -6,6 +6,17 @@
  *
  * Licensed under GPLv2, see file LICENSE in this source tree.
  */
+//config:config FUSER
+//config:      bool "fuser (7 kb)"
+//config:      default y
+//config:      help
+//config:      fuser lists all PIDs (Process IDs) that currently have a given
+//config:      file open. fuser can also list all PIDs that have a given network
+//config:      (TCP or UDP) port open.
+
+//applet:IF_FUSER(APPLET(fuser, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_FUSER) += fuser.o
 
 //usage:#define fuser_trivial_usage
 //usage:       "[OPTIONS] FILE or PORT/PROTO"
@@ -46,6 +57,7 @@ struct globals {
 } FIX_ALIASING;
 #define G (*(struct globals*)bb_common_bufsiz1)
 #define INIT_G() do { \
+       setup_common_bufsiz(); \
        G.mypid = getpid(); \
        G.killsig = SIGKILL; \
 } while (0)
@@ -287,8 +299,7 @@ int fuser_main(int argc UNUSED_PARAM, char **argv)
                break;
        }
 
-       opt_complementary = "-1"; /* at least one param */
-       getopt32(argv, OPTION_STRING);
+       getopt32(argv, "^" OPTION_STRING "\0" "-1"/*at least one arg*/);
        argv += optind;
 
        pp = argv;