]> git.neil.brown.name Git - history.git/commitdiff
[AF_UNIX]: Print out paths correctly in /proc/net/unix, matching 2.4.x
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>
Sun, 8 Feb 2004 05:03:26 +0000 (21:03 -0800)
committerDavid S. Miller <davem@nuts.davemloft.net>
Sun, 8 Feb 2004 05:03:26 +0000 (21:03 -0800)
net/unix/af_unix.c

index 82b66c6179ddfd331f5eac7be86eb69a921d04e0..c8d8dda2346193dfd53510e37b42b4ed01644303 100644 (file)
@@ -1863,14 +1863,19 @@ static int unix_seq_show(struct seq_file *seq, void *v)
                        sock_i_ino(s));
 
                if (u->addr) {
-                       int i;
+                       int i, len;
                        seq_putc(seq, ' ');
-                       
-                       for (i = 0; i < u->addr->len-sizeof(short); i++)
-                               seq_putc(seq, u->addr->name->sun_path[i]);
 
-                       if (UNIX_ABSTRACT(s))
+                       i = 0;
+                       len = u->addr->len - sizeof(short);
+                       if (!UNIX_ABSTRACT(s))
+                               len--;
+                       else {
                                seq_putc(seq, '@');
+                               i++;
+                       }
+                       for ( ; i < len; i++)
+                               seq_putc(seq, u->addr->name->sun_path[i]);
                }
                unix_state_runlock(s);
                seq_putc(seq, '\n');