mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
smaller tcp_connection_t
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@400 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
004d3874cd
commit
9a5602ded8
@ -763,7 +763,7 @@ void update_tcp_port_monitor_collection(
|
||||
FILE *fp;
|
||||
char buf[256];
|
||||
tcp_connection_t conn;
|
||||
unsigned long state;
|
||||
unsigned long inode,uid,state;
|
||||
|
||||
if ( !p_collection )
|
||||
return;
|
||||
@ -788,11 +788,11 @@ void update_tcp_port_monitor_collection(
|
||||
if ( sscanf (buf, "%*d: %lx:%lx %lx:%lx %lx %*x:%*x %*x:%*x %*x %lu %*d %lu",
|
||||
(unsigned long *)&conn.local_addr, (unsigned long *)&conn.local_port,
|
||||
(unsigned long *)&conn.remote_addr, (unsigned long *)&conn.remote_port,
|
||||
(unsigned long *)&state, (unsigned long *)&conn.uid, (unsigned long *)&conn.inode) != 7 )
|
||||
(unsigned long *)&state, (unsigned long *)&uid, (unsigned long *)&inode) != 7 )
|
||||
|
||||
fprintf( stderr, "/proc/net/tcp: bad file format\n" );
|
||||
|
||||
if ((conn.inode == 0) || (state != TCP_ESTABLISHED)) continue;
|
||||
if ((inode == 0) || (state != TCP_ESTABLISHED)) continue;
|
||||
|
||||
/* show the connection to each port monitor. */
|
||||
for_each_tcp_port_monitor_in_collection(
|
||||
|
@ -93,8 +93,6 @@ typedef struct _tcp_connection_t {
|
||||
in_port_t local_port;
|
||||
in_addr_t remote_addr;
|
||||
in_port_t remote_port;
|
||||
unsigned int uid;
|
||||
unsigned int inode;
|
||||
int age;
|
||||
} tcp_connection_t;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user