hush: fix a bug in argv restoration after sourcing a file
[oweals/busybox.git] / procps / fuser.c
index 05b52abb1c30edcce351694b1fe6a53c21283983..db28cca798c59b2fea8d6cd98f39c16e27b7eabc 100644 (file)
@@ -6,6 +6,17 @@
  *
  * Licensed under GPLv2, see file LICENSE in this source tree.
  */
+//config:config FUSER
+//config:      bool "fuser"
+//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"
@@ -18,6 +29,7 @@
 //usage:     "\n       -SIGNAL Signal to send (default: KILL)"
 
 #include "libbb.h"
+#include "common_bufsiz.h"
 
 #define MAX_LINE 255
 
@@ -43,8 +55,9 @@ struct globals {
        smallint kill_failed;
        int killsig;
 } FIX_ALIASING;
-#define G (*(struct globals*)&bb_common_bufsiz1)
+#define G (*(struct globals*)bb_common_bufsiz1)
 #define INIT_G() do { \
+       setup_common_bufsiz(); \
        G.mypid = getpid(); \
        G.killsig = SIGKILL; \
 } while (0)