Changeset 250
- Timestamp:
- Sep 22, 2009, 9:22:14 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/Changelog
r248 r250 2 2 * remove stale file record when creating handle, and raise diagnostic 3 3 error to find origin of stale record 4 * sh_port2proc.c: check /proc/net/upd6 for IPv6-only UDP sockets 4 5 5 6 2.5.9a: -
trunk/src/sh_port2proc.c
r244 r250 320 320 /* returns the command and fills the 'user' array 321 321 */ 322 char * sh_port2proc_query(int proto, struct in_addr * saddr, int sport, unsigned long * pid, 323 char * user, size_t userlen)322 static char * port2proc_query(char * file, int proto, struct in_addr * saddr, int sport, 323 unsigned long * pid, char * user, size_t userlen) 324 324 { 325 325 FILE * fd; 326 326 327 if (proto == IPPROTO_TCP) 328 fd = fopen("/proc/net/tcp", "r"); 329 else 330 fd = fopen("/proc/net/udp", "r"); 327 fd = fopen(file, "r"); 331 328 332 329 *pid = 0; … … 377 374 sl_strlcpy(user, "-", userlen); 378 375 return sh_util_strdup("-"); 376 } 377 378 /* returns the command and fills the 'user' array 379 */ 380 char * sh_port2proc_query(int proto, struct in_addr * saddr, int sport, 381 unsigned long * pid, char * user, size_t userlen) 382 { 383 char file[32]; 384 385 if (proto == IPPROTO_TCP) 386 { 387 sl_strlcpy(file, _("/proc/net/tcp"), sizeof(file)); 388 return port2proc_query(file, proto, saddr, sport, pid, user, userlen); 389 } 390 else 391 { 392 char * ret; 393 sl_strlcpy(file, _("/proc/net/udp"), sizeof(file)); 394 ret = port2proc_query(file, proto, saddr, sport, pid, user, userlen); 395 if (ret[0] == '-' && ret[1] == '\0') 396 { 397 SH_FREE(ret); 398 sl_strlcpy(file, _("/proc/net/udp6"), sizeof(file)); 399 ret = port2proc_query(file, proto, saddr, sport, pid, user, userlen); 400 } 401 return ret; 402 } 379 403 } 380 404
Note:
See TracChangeset
for help on using the changeset viewer.