Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

"systat vm" warning "can't get buffers" with patch



I frequently leave "systat vm" running in a tmux window and regularly
get the "can't get buffers:" warning. I was curious enough that I
believe the attached patch will likely prevent it. Diff is against the
netbsd-9 branch, but it should apply cleanly against head.

Cheers,
-- 
Paul Ripke
"Great minds discuss ideas, average minds discuss events, small minds
 discuss people."
-- Disputed: Often attributed to Eleanor Roosevelt. 1948.
diff --git a/usr.bin/systat/bufcache.c b/usr.bin/systat/bufcache.c
index 43c9c112a952..92d273a0ab39 100644
--- a/usr.bin/systat/bufcache.c
+++ b/usr.bin/systat/bufcache.c
@@ -290,8 +290,8 @@ again:
 	}
 	if (sysctl(mib, 6, buffers, &size, NULL, 0) < 0) {
 		free(buffers);
-		if (extraslop == 0) {
-			extraslop = 100;
+		if (extraslop < 1000) {
+			extraslop += 100;
 			goto again;
 		}
 		error("can't get buffers: %s\n", strerror(errno));
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index a1746d57dbcd..b7795bde86ce 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -552,8 +552,8 @@ again:
 	}
 	if (sysctl(mib, 6, buffers, &size, NULL, 0) < 0) {
 		free(buffers);
-		if (extraslop == 0) {
-			extraslop = 100;
+		if (extraslop < 1000) {
+			extraslop += 100;
 			goto again;
 		}
 		error("can't get buffers: %s\n", strerror(errno));


Home | Main Index | Thread Index | Old Index