Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F114735810
D29337.id86005.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D29337.id86005.diff
View Options
Index: usr.bin/systat/devs.h
===================================================================
--- usr.bin/systat/devs.h
+++ usr.bin/systat/devs.h
@@ -2,7 +2,7 @@
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 1998 David E. O'Brien
- * 2015 Yoshihiro Ota
+ * 2015, 2021 Yoshihiro Ota
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,8 @@
#include <devstat.h>
+#define DISKHIGHT 5
+
int dsinit(int);
void dsgetinfo(struct statinfo *);
int dscmd(const char *, const char *, int, struct statinfo *);
Index: usr.bin/systat/devs.c
===================================================================
--- usr.bin/systat/devs.c
+++ usr.bin/systat/devs.c
@@ -426,13 +426,6 @@
putlongdouble(device_busy, diskrow + 4, lc, 5, 0, 0);
}
-static void
-dsshow3(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then)
-{
-
- dsshow2(diskcol, diskrow, dn, lc, now, then);
-}
-
void
dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct statinfo *then)
{
@@ -440,5 +433,5 @@
for (i = 0, lc = 0; i < num_devices && lc < maxdrives; i++)
if (dev_select[i].selected)
- dsshow3(diskcol, diskrow, i, ++lc, now, then);
+ dsshow2(diskcol, diskrow, i, ++lc, now, then);
}
Index: usr.bin/systat/main.c
===================================================================
--- usr.bin/systat/main.c
+++ usr.bin/systat/main.c
@@ -135,6 +135,21 @@
}
+static void
+resize(int signo __unused)
+{
+
+ endwin();
+ refresh();
+ clear();
+
+ CMDLINE = LINES - 1;
+ labels();
+ display();
+ status();
+}
+
+
int
main(int argc, char **argv)
{
@@ -191,6 +206,7 @@
signal(SIGINT, die);
signal(SIGQUIT, die);
signal(SIGTERM, die);
+ signal(SIGWINCH, resize);
/*
* Initialize display. Load average appears in a one line
Index: usr.bin/systat/swap.c
===================================================================
--- usr.bin/systat/swap.c
+++ usr.bin/systat/swap.c
@@ -136,7 +136,7 @@
werase(wnd);
- dslabel(12, 0, 18);
+ dslabel(12, 0, LINES - DISKHIGHT - 1);
if (kvnsw <= 0) {
mvwprintw(wnd, 0, 0, "(swap not configured)");
@@ -162,7 +162,7 @@
if (kvnsw != okvnsw)
labelswap();
- dsshow(12, 0, 18, &cur_dev, &last_dev);
+ dsshow(12, 0, LINES - DISKHIGHT - 1, &cur_dev, &last_dev);
if (kvnsw <= 0)
return;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 17, 3:34 AM (14 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17573342
Default Alt Text
D29337.id86005.diff (2 KB)
Attached To
Mode
D29337: systat: Handle SIGWINCH to properly window resizing and adjust -swap disk stat based on new size.
Attached
Detach File
Event Timeline
Log In to Comment