bin/113777: Noisy error message from sockstat

Dmitrij Tejblum tejblum at yandex-team.ru
Sat Jun 16 19:30:21 UTC 2007


>Number:         113777
>Category:       bin
>Synopsis:       Noisy error message from sockstat
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 16 19:30:20 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Dmitrij Tejblum
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
OOO Yandex
>Environment:

>Description:

Sometimes a process exits before its name were learned by sockstat. 
Then sockstat print an error message. Since there is nothing goes wrong here,
no error message should be printed in this case.

>How-To-Repeat:

>Fix:

--- sockstat.c.	Fri Jun 10 10:36:03 2005
+++ sockstat.c	Sat Jun 16 20:48:28 2007
@@ -456,7 +456,8 @@ getprocname(pid_t pid)
 	mib[3] = (int)pid;
 	len = sizeof proc;
 	if (sysctl(mib, 4, &proc, &len, NULL, 0) == -1) {
-		warn("sysctl()");
+		if (errno != ESRCH)
+			warn("sysctl()");
 		return ("??");
 	}
 	return (proc.ki_ocomm);


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list