Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jun 2007 22:59:15 +0400 (MSD)
From:      Dmitrij Tejblum <tejblum@yandex-team.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/113777: Noisy error message from sockstat
Message-ID:  <200706161859.l5GIxFBx004414@cmail.yandex.ru>
Resent-Message-ID: <200706161930.l5GJUKkv005137@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706161859.l5GIxFBx004414>