1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-31 21:57:12 +00:00
freebsd-ports/sysutils/tcplist/files/patch-02
David E. O'Brien 07df187a7a Tcplist makes a list of tcp connections to and from the local machine,
displaying the user name associated with the local end, and making use of
Ident services if available to determine the "user" at the other end.

Tcplist uses LSOF to do its low level work on 4.4BSD machines.
1997-04-24 08:04:53 +00:00

29 lines
648 B
Plaintext

--- tcplist.c.orig Tue Apr 15 00:28:29 1997
+++ tcplist.c Tue Apr 15 00:31:40 1997
@@ -37,6 +37,10 @@
#include <arpa/inet.h>
#include <netdb.h>
+#if ((defined(__unix__) || defined(unix)) && !defined(USG))
+#include <sys/param.h>
+#endif
+
#include "utils.h"
#include "tcplist.h"
@@ -346,10 +350,14 @@
if(verbose) printf("Connecting to remote hosts.\n");
+#if (defined(BSD) && (BSD >= 199103))
+ maxfd=getdtablesize(); /* could also use getrlimit(2) here... */
+#else
if(0>(maxfd=ulimit(4,0l))){
perror("ulimit");
exit(2);
}
+#endif
/* waltz through the connections in the hostlist, setting idents */
/* to NULL */