Downgrade glibtop_error_io() to glibtop_warn_io() on failed kvm_getprocs().

There is realy nothing abnormal if client app trying to query data for
just dissapeared process. glibtop_error_io() call always end up with exit()
which is not what people may expect.
This commit is contained in:
Alexander Nedotsukov 2005-03-18 18:16:38 +00:00
parent ac60bf3260
commit 0b879af755
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=131580
4 changed files with 42 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= libgtop2
PORTVERSION= 2.10.0
PORTREVISION= 1
CATEGORIES= devel gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/${PORTNAME:S/2$//}/2.10

View File

@ -0,0 +1,15 @@
--- sysdeps/freebsd/prockernel.c Mon Jul 19 05:33:56 2004
+++ sysdeps/freebsd/prockernel.c.orig Sat Mar 19 02:39:47 2005
@@ -115,8 +115,10 @@
/* Get the process information */
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
- if ((pinfo == NULL) || (count != 1))
- glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
+ if ((pinfo == NULL) || (count != 1)) {
+ glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
+ return;
+ }
#if defined(__FreeBSD__) && (__FreeBSD_version >= 500013)

View File

@ -0,0 +1,11 @@
--- sysdeps/freebsd/procmap.c Wed Feb 23 17:20:45 2005
+++ sysdeps/freebsd/procmap.c.orig Sat Mar 19 02:46:57 2005
@@ -129,7 +129,7 @@
/* Get the process data */
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
if ((pinfo == NULL) || (count < 1)) {
- glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
+ glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
return NULL;
}

View File

@ -0,0 +1,15 @@
--- sysdeps/freebsd/proctime.c Wed Feb 23 17:20:45 2005
+++ sysdeps/freebsd/proctime.c.orig Sat Mar 19 02:38:31 2005
@@ -146,8 +146,10 @@
/* Get the process information */
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
- if ((pinfo == NULL) || (count != 1))
- glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
+ if ((pinfo == NULL) || (count != 1)) {
+ glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
+ return;
+ }
#if defined(__FreeBSD__) && (__FreeBSD_version >= 500013)
buf->rtime = pinfo [0].ki_runtime;