[BACK]Return to unix.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / netstat

Diff for /src/usr.bin/netstat/unix.c between version 1.11 and 1.12

version 1.11, 2004/03/13 22:02:13 version 1.12, 2005/03/25 17:01:04
Line 76 
Line 76 
         char *filebuf;          char *filebuf;
         struct protosw *unixsw = (struct protosw *)off;          struct protosw *unixsw = (struct protosw *)off;
   
         filebuf = (char *)kvm_getfiles(kvmd, KERN_FILE, 0, &nfiles);          filebuf = kvm_getfiles(kvmd, KERN_FILE, 0, &nfiles);
         if (filebuf == NULL) {          if (filebuf == NULL) {
                 printf("Out of memory (file table).\n");                  printf("Out of memory (file table).\n");
                 return;                  return;
Line 86 
Line 86 
         for (fp = file; fp < fileNFILE; fp++) {          for (fp = file; fp < fileNFILE; fp++) {
                 if (fp->f_count == 0 || fp->f_type != DTYPE_SOCKET)                  if (fp->f_count == 0 || fp->f_type != DTYPE_SOCKET)
                         continue;                          continue;
                 if (kread((u_long)fp->f_data, (char *)so, sizeof (*so)))                  if (kread((u_long)fp->f_data, so, sizeof (*so)))
                         continue;                          continue;
                 /* kludge */                  /* kludge */
                 if (so->so_proto >= unixsw && so->so_proto <= unixsw + 2)                  if (so->so_proto >= unixsw && so->so_proto <= unixsw + 2)
Line 106 
Line 106 
         struct sockaddr_un *sa = NULL;          struct sockaddr_un *sa = NULL;
         static int first = 1;          static int first = 1;
   
         if (kread((u_long)so->so_pcb, (char *)unp, sizeof (*unp)))          if (kread((u_long)so->so_pcb, unp, sizeof (*unp)))
                 return;                  return;
         if (unp->unp_addr) {          if (unp->unp_addr) {
                 m = &mbuf;                  m = &mbuf;
                 if (kread((u_long)unp->unp_addr, (char *)m, sizeof (*m)))                  if (kread((u_long)unp->unp_addr, m, sizeof (*m)))
                         m = NULL;                          m = NULL;
                 sa = (struct sockaddr_un *)(m->m_dat);                  sa = (struct sockaddr_un *)(m->m_dat);
         } else          } else

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12