]> granicus.if.org Git - psmisc/commitdiff
fuser -k return and fuser.1 ipv6 addresses
authorCraig Small <csmall@users.sourceforge.net>
Sun, 19 Jun 2011 04:14:22 +0000 (14:14 +1000)
committerCraig Small <csmall@users.sourceforge.net>
Sun, 19 Jun 2011 04:14:22 +0000 (14:14 +1000)
fuser understands IPv6 addresses, removed comment in fuser.1 that it
 doesn't Debian #609904
fuser -k only returns 0 if you kill something.

ChangeLog
doc/fuser.1
src/fuser.c

index c67e16f70ad3a6579ea8a079c062ddf0bfc8384a..571c5eb5e16007995927cf7e2e4480afe45734dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,7 +14,10 @@ Changes in 22.14
          Hawthorne SF#3135157
        * killall creates right size buffer instead of MAX_PATH Debian #623425
        * check for /proc/$$/stat not /proc/self/stat which is not available
-         on hurb platforms. Same Debian bug as above
+         on hurd platforms. Same Debian bug as above
+       * fuser understands IPv6 addresses, removed comment in fuser.1 that it
+         doesn't Debian #609904
+       * fuser -k only returns 0 if you kill something.
 
 Changes in 22.13
 ================
index 0853882ba8fd4ae2a9cc7a584145ea5325267cbb..d409f779f42688125cdb96f2bcb6c848b5a46e09 100644 (file)
@@ -1,4 +1,4 @@
-.TH FUSER 1 2009-11-23 "Linux" "User Commands"
+.TH FUSER 1 2011-06-19 "Linux" "User Commands"
 .SH NAME
 fuser \- identify processes using files or sockets
 .SH SYNOPSIS
@@ -170,9 +170,6 @@ reasons.
 \fBudp\fR and \fBtcp\fR name spaces, and UNIX domain sockets can't be
 searched with kernels older than 1.3.78.
 .PP
-\fBudp\fR and \fBtcp\fR currently  work with IPv6 and IPv4, but the
-address fields can only be IPv4 addresses.
-.PP
 Accesses by the kernel are only shown with the \fB\-v\fR option.
 .PP
 The \fB\-k\fR option only works on processes. If the user is the kernel,
index 65bd5ae9ecad3d4283affac773a766edee4768b6..87a13bf60f87aa15f252884b849092407b1abb00 100644 (file)
@@ -4,7 +4,7 @@
  * Based on fuser.c Copyright (C) 1993-2005 Werner Almesberger and Craig Small
  *
  * Completely re-written
- * Copyright (C) 2005-2010 Craig Small
+ * Copyright (C) 2005-2011 Craig Small
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -983,6 +983,7 @@ int main(int argc, char *argv[])
                        return 0;
                  case 'm':
                        opts |= OPT_MOUNTS;
+                   read_proc_mounts(&mounts);
                        break;
                  case 'M':
                        opts |= OPT_ISMOUNTPOINT;
@@ -1162,11 +1163,12 @@ print_matches(struct names *names_head, const opt_type opts,
        struct passwd *pwent = NULL;
        int have_match = 0;
        int have_kill = 0;
-       int name_has_procs;
+       int name_has_procs = 0;
 
        for (nptr = names_head; nptr != NULL; nptr = nptr->next) {
                if (opts & OPT_SILENT) {
-                       have_match = nptr->matched_procs ? 1 : have_match;
+            if (nptr->matched_procs != NULL)
+                have_match = 1;
                } else {        /* We're not silent */
                        if ((opts & OPT_ALLFILES) == 0) {
                                name_has_procs = 0;
@@ -1306,7 +1308,10 @@ print_matches(struct names *names_head, const opt_type opts,
                                                      opts, sig_number);
 
        }                       /* next name */
-       return (have_match == 1 ? 0 : 1);
+    if (opts & OPT_KILL)
+        return (have_kill == 1 ? 0 : 1);
+    else
+        return (have_match == 1 ? 0 : 1);
 
 }