File net-tools-1.60-netstat-p.patch of Package net-tools

diff -Naurp net-tools-1.60/netstat.c net-tools-1.60-new/netstat.c
--- net-tools-1.60/netstat.c	2006-03-17 14:01:23.000000000 +0530
+++ net-tools-1.60-new/netstat.c	2006-03-17 13:58:47.000000000 +0530
@@ -231,7 +231,7 @@ static struct iface_cache* mycache;
 
 static struct prg_node {
     struct prg_node *next;
-    int inode;
+    unsigned long inode;
     char name[PROGNAME_WIDTH];
 } *prg_hash[PRG_HASH_SIZE];
 
@@ -335,7 +335,7 @@ int do_if_cache_print(struct interface *
      return res;
 }
 
-static void prg_cache_add(int inode, char *name)
+static void prg_cache_add(unsigned long inode, char *name)
 {
     unsigned hi = PRG_HASHIT(inode);
     struct prg_node **pnp,*pn;
@@ -358,7 +358,7 @@ static void prg_cache_add(int inode, cha
     strcpy(pn->name,name);
 }
 
-static const char *prg_cache_get(int inode)
+static const char *prg_cache_get(unsigned long inode)
 {
     unsigned hi=PRG_HASHIT(inode);
     struct prg_node *pn;
@@ -1185,7 +1185,8 @@ static void unix_do_one(int nr, const ch
     static int has = 0;
     char path[MAXPATHLEN], ss_flags[32];
     char *ss_proto, *ss_state, *ss_type;
-    int num, state, type, inode;
+    int num, state, type;
+    unsigned long inode;
     void *d;
     unsigned long refcnt, proto, flags;
 
@@ -1195,14 +1196,14 @@ static void unix_do_one(int nr, const ch
 	return;
     }
     path[0] = '\0';
-    num = sscanf(line, "%p: %lX %lX %lX %X %X %d %s",
+    num = sscanf(line, "%p: %lX %lX %lX %X %X %ld %s",
 		 &d, &refcnt, &proto, &flags, &type, &state, &inode, path);
     if (num < 6) {
 	fprintf(stderr, _("warning, got bogus unix line.\n"));
 	return;
     }
     if (!(has & HAS_INODE))
-	snprintf(path,sizeof(path),"%d",inode);
+	snprintf(path,sizeof(path),"%ld",inode);
 
     if (!flag_all) {
     	if ((state == SS_UNCONNECTED) && (flags & SO_ACCEPTCON)) {
@@ -1294,7 +1295,7 @@ static void unix_do_one(int nr, const ch
     printf("%-5s %-6ld %-11s %-10s %-13s ",
 	   ss_proto, refcnt, ss_flags, ss_type, ss_state);
     if (has & HAS_INODE)
-	printf("%-6d ",inode);
+	printf("%-6ld ",inode);
     else
 	printf("-      ");
     if (flag_prg)

openSUSE Build Service is sponsored by