]> granicus.if.org Git - psmisc/commitdiff
ifdefed the nfs stuff for now
authorCraig Small <csmall@users.sourceforge.net>
Thu, 3 Aug 2006 03:08:40 +0000 (03:08 +0000)
committerCraig Small <csmall@users.sourceforge.net>
Thu, 3 Aug 2006 03:08:40 +0000 (03:08 +0000)
ChangeLog
doc/fuser.1
src/fuser.c
src/fuser.h

index 25eb5273e7a5eb3068c6e8caffca43408b2f5b49..13120f39b3ce7e8cd7959fb9a988391eb8b4bc45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,11 @@
 Changes in 22.3
 ================
+2006-05-25 Craig Small
+       * Updated Swedish PO file
+       * Fixed fuser man page ... Debian #358880
+
 2006-04-05 Karel Zak
-       * fuser return code set correcly in silent mode
+       * fuser return code set correcly in silent mode Debian #361639
        * fuser -l doesnt complain but list signal names only
 
 2006-03-24 Craig Small
index d88b503c737501c53df85849d9c52be32a90e532..8f410b2c2e36398c9b6dcd3cac55190ef0161be5 100644 (file)
@@ -13,8 +13,7 @@ fuser \- identify processes using files or sockets
 .RB [ \- \fIsignal
 ] ]
 .RB [ \-muvf ]
-.I name
-...
+.IR name " ..."
 .br
 .B fuser
 .RB \-l
index 93cd39843d26de18c62d07cfe6d2fddf9c72b87d..4435e4ccaecce642127d99e1ed4dc089e041ae48 100644 (file)
@@ -50,7 +50,9 @@
 #include "signals.h"
 #include "i18n.h"
 
-/*#define DEBUG 1*/
+/*#define DEBUG 1
+#define NFS_CHECKS 
+*/
 
 #define NAME_FIELD 20          /* space reserved for file name */
 /* Function defines */
@@ -67,6 +69,10 @@ static void add_device(struct device_list **dev_list, struct names  *this_name,
 void scan_mount_devices(const opt_type opts, struct mountdev_list **mount_devices);
 void fill_unix_cache(struct unixsocket_list **unixsocket_head);
 static dev_t find_net_dev(void);
+static void scan_procs(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head);
+#ifdef NFS_CHECKS
+static void scan_knfsd(struct names *names_head, struct device_list *dev_head);
+#endif /* NFS_CHECKS */
 #ifdef DEBUG
 static void debug_match_lists(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head);
 #endif
@@ -832,6 +838,9 @@ int main(int argc, char *argv[])
        debug_match_lists(names_head, match_inodes, match_devices);
 #endif
        scan_procs(names_head, match_inodes, match_devices);
+#ifdef NFS_CHECKS
+    scan_knfsd(names_head, match_devices);
+#endif /* NFS_CHECKS */
        return print_matches(names_head,opts, sig_number);
 }
 
@@ -1196,4 +1205,37 @@ static dev_t find_net_dev(void)
   return st.st_dev;
 }
 
+#ifdef NFS_CHECKS
+static void scan_knfsd(struct names *names_head, struct device_list *dev_head)
+{
+       struct device_list *dev_tmp;
+       FILE *fp;
+       char line[BUFSIZ];
+    char *find_space;
+    struct stat st;
 
+    if ( (fp = fopen(KNFSD_EXPORTS, "r")) == NULL) {
+#ifdef DEBUG
+      fprintf(stderr, "Cannot open %s\n", KNFSD_EXPORTS);
+#endif
+      return;
+    }
+       while (fgets(line, BUFSIZ, fp) != NULL) {
+      if (line[0] == '#') { continue; }
+      if ( (find_space=strpbrk(line," \t")) == NULL) {
+        continue;
+      }
+      *find_space = '\0';
+      if ( stat(line, &st) != 0) {
+    printf("hello %s\n", line);
+        continue;
+      }
+      printf("looking for dev %0x\n", st.st_dev);
+      /* Scan the devices */
+         for (dev_tmp = dev_head ; dev_tmp != NULL ; dev_tmp = dev_tmp->next) {
+         printf("dev %d\n", dev_tmp->device);
+       }
+
+    }
+}
+#endif /* NFSCHECKS */
index b887d1229c76b18f04cb33746a9e1ba1d470fb43..f15ba7e182265005af45df6868e55597794353ea 100644 (file)
@@ -86,3 +86,5 @@ struct unixsocket_list {
 
 #define MAX_PATHNAME 200
 #define MAX_CMDNAME 16
+
+#define KNFSD_EXPORTS "/proc/fs/nfs/exports"