Fix whitespace inconsistencies in systat(1).
According to md5(1), the resulting binary is the same.
This commit is contained in:
parent
126b36a21e
commit
2bd338d6c4
@ -47,32 +47,32 @@ static const char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95";
|
|||||||
void
|
void
|
||||||
command(const char *cmd)
|
command(const char *cmd)
|
||||||
{
|
{
|
||||||
struct cmdtab *p;
|
struct cmdtab *p;
|
||||||
char *cp, *tmpstr, *tmpstr1;
|
char *cp, *tmpstr, *tmpstr1;
|
||||||
int interval, omask;
|
int interval, omask;
|
||||||
|
|
||||||
tmpstr = tmpstr1 = strdup(cmd);
|
tmpstr = tmpstr1 = strdup(cmd);
|
||||||
omask = sigblock(sigmask(SIGALRM));
|
omask = sigblock(sigmask(SIGALRM));
|
||||||
for (cp = tmpstr1; *cp && !isspace(*cp); cp++)
|
for (cp = tmpstr1; *cp && !isspace(*cp); cp++)
|
||||||
;
|
;
|
||||||
if (*cp)
|
if (*cp)
|
||||||
*cp++ = '\0';
|
*cp++ = '\0';
|
||||||
if (*tmpstr1 == '\0')
|
if (*tmpstr1 == '\0')
|
||||||
return;
|
return;
|
||||||
for (; *cp && isspace(*cp); cp++)
|
for (; *cp && isspace(*cp); cp++)
|
||||||
;
|
;
|
||||||
if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0)
|
if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0)
|
||||||
die(0);
|
die(0);
|
||||||
if (strcmp(tmpstr1, "load") == 0) {
|
if (strcmp(tmpstr1, "load") == 0) {
|
||||||
load();
|
load();
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (strcmp(tmpstr1, "stop") == 0) {
|
if (strcmp(tmpstr1, "stop") == 0) {
|
||||||
alarm(0);
|
alarm(0);
|
||||||
mvaddstr(CMDLINE, 0, "Refresh disabled.");
|
mvaddstr(CMDLINE, 0, "Refresh disabled.");
|
||||||
clrtoeol();
|
clrtoeol();
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (strcmp(tmpstr1, "help") == 0) {
|
if (strcmp(tmpstr1, "help") == 0) {
|
||||||
int _col, _len;
|
int _col, _len;
|
||||||
|
|
||||||
@ -89,30 +89,30 @@ command(const char *cmd)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
interval = atoi(tmpstr1);
|
interval = atoi(tmpstr1);
|
||||||
if (interval <= 0 &&
|
if (interval <= 0 &&
|
||||||
(strcmp(tmpstr1, "start") == 0 || strcmp(tmpstr1, "interval") == 0)) {
|
(strcmp(tmpstr1, "start") == 0 || strcmp(tmpstr1, "interval") == 0)) {
|
||||||
interval = *cp ? atoi(cp) : naptime;
|
interval = *cp ? atoi(cp) : naptime;
|
||||||
if (interval <= 0) {
|
if (interval <= 0) {
|
||||||
error("%d: bad interval.", interval);
|
error("%d: bad interval.", interval);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (interval > 0) {
|
if (interval > 0) {
|
||||||
alarm(0);
|
alarm(0);
|
||||||
naptime = interval;
|
naptime = interval;
|
||||||
display(0);
|
display(0);
|
||||||
status();
|
status();
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
p = lookup(tmpstr1);
|
p = lookup(tmpstr1);
|
||||||
if (p == (struct cmdtab *)-1) {
|
if (p == (struct cmdtab *)-1) {
|
||||||
error("%s: Ambiguous command.", tmpstr1);
|
error("%s: Ambiguous command.", tmpstr1);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (p) {
|
if (p) {
|
||||||
if (curcmd == p)
|
if (curcmd == p)
|
||||||
goto done;
|
goto done;
|
||||||
alarm(0);
|
alarm(0);
|
||||||
(*curcmd->c_close)(wnd);
|
(*curcmd->c_close)(wnd);
|
||||||
curcmd->c_flags &= ~CF_INIT;
|
curcmd->c_flags &= ~CF_INIT;
|
||||||
wnd = (*p->c_open)();
|
wnd = (*p->c_open)();
|
||||||
@ -131,12 +131,12 @@ command(const char *cmd)
|
|||||||
else
|
else
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
curcmd = p;
|
curcmd = p;
|
||||||
labels();
|
labels();
|
||||||
display(0);
|
display(0);
|
||||||
status();
|
status();
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp))
|
if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp))
|
||||||
error("%s: Unknown command.", tmpstr1);
|
error("%s: Unknown command.", tmpstr1);
|
||||||
done:
|
done:
|
||||||
@ -176,18 +176,18 @@ void
|
|||||||
status(void)
|
status(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
error("Showing %s, refresh every %d seconds.",
|
error("Showing %s, refresh every %d seconds.",
|
||||||
curcmd->c_name, naptime);
|
curcmd->c_name, naptime);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
prefix(const char *s1, const char *s2)
|
prefix(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
|
|
||||||
while (*s1 == *s2) {
|
while (*s1 == *s2) {
|
||||||
if (*s1 == '\0')
|
if (*s1 == '\0')
|
||||||
return (1);
|
return (1);
|
||||||
s1++, s2++;
|
s1++, s2++;
|
||||||
}
|
}
|
||||||
return (*s1 == '\0');
|
return (*s1 == '\0');
|
||||||
}
|
}
|
||||||
|
@ -40,22 +40,22 @@ static const char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
|
|||||||
#include "mode.h"
|
#include "mode.h"
|
||||||
|
|
||||||
struct cmdtab cmdtab[] = {
|
struct cmdtab cmdtab[] = {
|
||||||
{ "pigs", showpigs, fetchpigs, labelpigs,
|
{ "pigs", showpigs, fetchpigs, labelpigs,
|
||||||
initpigs, openpigs, closepigs, 0,
|
initpigs, openpigs, closepigs, 0,
|
||||||
0, CF_LOADAV },
|
0, CF_LOADAV },
|
||||||
{ "swap", showswap, fetchswap, labelswap,
|
{ "swap", showswap, fetchswap, labelswap,
|
||||||
initswap, openswap, closeswap, 0,
|
initswap, openswap, closeswap, 0,
|
||||||
0, CF_LOADAV },
|
0, CF_LOADAV },
|
||||||
{ "mbufs", showmbufs, fetchmbufs, labelmbufs,
|
{ "mbufs", showmbufs, fetchmbufs, labelmbufs,
|
||||||
initmbufs, openmbufs, closembufs, 0,
|
initmbufs, openmbufs, closembufs, 0,
|
||||||
0, CF_LOADAV },
|
0, CF_LOADAV },
|
||||||
{ "iostat", showiostat, fetchiostat, labeliostat,
|
{ "iostat", showiostat, fetchiostat, labeliostat,
|
||||||
initiostat, openiostat, closeiostat, cmdiostat,
|
initiostat, openiostat, closeiostat, cmdiostat,
|
||||||
0, CF_LOADAV },
|
0, CF_LOADAV },
|
||||||
{ "vmstat", showkre, fetchkre, labelkre,
|
{ "vmstat", showkre, fetchkre, labelkre,
|
||||||
initkre, openkre, closekre, cmdkre,
|
initkre, openkre, closekre, cmdkre,
|
||||||
0, 0 },
|
0, 0 },
|
||||||
{ "netstat", shownetstat, fetchnetstat, labelnetstat,
|
{ "netstat", shownetstat, fetchnetstat, labelnetstat,
|
||||||
initnetstat, opennetstat, closenetstat, cmdnetstat,
|
initnetstat, opennetstat, closenetstat, cmdnetstat,
|
||||||
0, CF_LOADAV },
|
0, CF_LOADAV },
|
||||||
{ "icmp", showicmp, fetchicmp, labelicmp,
|
{ "icmp", showicmp, fetchicmp, labelicmp,
|
||||||
@ -78,6 +78,6 @@ struct cmdtab cmdtab[] = {
|
|||||||
{ "ifstat", showifstat, fetchifstat, labelifstat,
|
{ "ifstat", showifstat, fetchifstat, labelifstat,
|
||||||
initifstat, openifstat, closeifstat, cmdifstat,
|
initifstat, openifstat, closeifstat, cmdifstat,
|
||||||
0, CF_LOADAV },
|
0, CF_LOADAV },
|
||||||
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 }
|
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
struct cmdtab *curcmd = &cmdtab[0];
|
struct cmdtab *curcmd = &cmdtab[0];
|
||||||
|
@ -105,7 +105,7 @@ dsinit(int maxshowdevs, struct statinfo *s1, struct statinfo *s2 __unused,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure that the userland devstat version matches the kernel
|
* Make sure that the userland devstat version matches the kernel
|
||||||
* devstat version. If not, exit and print a message informing
|
* devstat version. If not, exit and print a message informing
|
||||||
* the user of his mistake.
|
* the user of his mistake.
|
||||||
*/
|
*/
|
||||||
if (devstat_checkversion(NULL) < 0)
|
if (devstat_checkversion(NULL) < 0)
|
||||||
@ -155,10 +155,10 @@ dscmd(const char *cmd, const char *args, int maxshowdevs, struct statinfo *s1)
|
|||||||
if (prefix(cmd, "refresh")) {
|
if (prefix(cmd, "refresh")) {
|
||||||
retval = devstat_selectdevs(&dev_select, &num_selected,
|
retval = devstat_selectdevs(&dev_select, &num_selected,
|
||||||
&num_selections, &select_generation, generation,
|
&num_selections, &select_generation, generation,
|
||||||
s1->dinfo->devices, num_devices,
|
s1->dinfo->devices, num_devices,
|
||||||
(last_type ==DS_MATCHTYPE_PATTERN) ? matches : NULL,
|
(last_type ==DS_MATCHTYPE_PATTERN) ? matches : NULL,
|
||||||
(last_type ==DS_MATCHTYPE_PATTERN) ? num_matches : 0,
|
(last_type ==DS_MATCHTYPE_PATTERN) ? num_matches : 0,
|
||||||
(last_type == DS_MATCHTYPE_SPEC) ?specified_devices : NULL,
|
(last_type == DS_MATCHTYPE_SPEC) ?specified_devices : NULL,
|
||||||
(last_type == DS_MATCHTYPE_SPEC) ?num_devices_specified : 0,
|
(last_type == DS_MATCHTYPE_SPEC) ?num_devices_specified : 0,
|
||||||
(last_type == DS_MATCHTYPE_NONE) ? DS_SELECT_ADD :
|
(last_type == DS_MATCHTYPE_NONE) ? DS_SELECT_ADD :
|
||||||
DS_SELECT_ADDONLY, maxshowdevs, 0);
|
DS_SELECT_ADDONLY, maxshowdevs, 0);
|
||||||
@ -220,7 +220,7 @@ dsmatchselect(const char *args, devstat_select_mode select_mode, int maxshowdevs
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < num_args; i++) {
|
for (i = 0; i < num_args; i++) {
|
||||||
if (devstat_buildmatch(tstr[i], &matches, &num_matches) != 0) {
|
if (devstat_buildmatch(tstr[i], &matches, &num_matches) != 0) {
|
||||||
warnx("%s", devstat_errbuf);
|
warnx("%s", devstat_errbuf);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ dsselect(const char *args, devstat_select_mode select_mode, int maxshowdevs,
|
|||||||
asprintf(&buffer, "%s%d", dev_select[i].device_name,
|
asprintf(&buffer, "%s%d", dev_select[i].device_name,
|
||||||
dev_select[i].unit_number);
|
dev_select[i].unit_number);
|
||||||
if (strcmp(buffer, tmpstr1) == 0) {
|
if (strcmp(buffer, tmpstr1) == 0) {
|
||||||
|
|
||||||
num_devices_specified++;
|
num_devices_specified++;
|
||||||
|
|
||||||
specified_devices =(char **)realloc(
|
specified_devices =(char **)realloc(
|
||||||
|
@ -62,17 +62,17 @@ void getsysctl(const char *name, void *ptr, size_t len)
|
|||||||
{
|
{
|
||||||
size_t nlen = len;
|
size_t nlen = len;
|
||||||
if (sysctlbyname(name, ptr, &nlen, NULL, 0) != 0) {
|
if (sysctlbyname(name, ptr, &nlen, NULL, 0) != 0) {
|
||||||
error("sysctl(%s...) failed: %s", name,
|
error("sysctl(%s...) failed: %s", name,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
if (nlen != len) {
|
if (nlen != len) {
|
||||||
error("sysctl(%s...) expected %lu, got %lu", name,
|
error("sysctl(%s...) expected %lu, got %lu", name,
|
||||||
(unsigned long)len, (unsigned long)nlen);
|
(unsigned long)len, (unsigned long)nlen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read sysctl data with variable size. Try some times (with increasing
|
* Read sysctl data with variable size. Try some times (with increasing
|
||||||
* buffers), fail if still too small.
|
* buffers), fail if still too small.
|
||||||
* This is needed sysctls with possibly raplidly increasing data sizes,
|
* This is needed sysctls with possibly raplidly increasing data sizes,
|
||||||
* but imposes little overhead in the case of constant sizes.
|
* but imposes little overhead in the case of constant sizes.
|
||||||
@ -84,8 +84,8 @@ void getsysctl(const char *name, void *ptr, size_t len)
|
|||||||
/* Some defines: Number of tries. */
|
/* Some defines: Number of tries. */
|
||||||
#define SD_NTRIES 10
|
#define SD_NTRIES 10
|
||||||
/* Percent of over-allocation (initial) */
|
/* Percent of over-allocation (initial) */
|
||||||
#define SD_MARGIN 10
|
#define SD_MARGIN 10
|
||||||
/*
|
/*
|
||||||
* Factor for over-allocation in percent (the margin is increased by this on
|
* Factor for over-allocation in percent (the margin is increased by this on
|
||||||
* any failed try).
|
* any failed try).
|
||||||
*/
|
*/
|
||||||
|
@ -47,7 +47,7 @@ ifcmd(const char *cmd, const char *args)
|
|||||||
clrtoeol();
|
clrtoeol();
|
||||||
addstr("what scale? ");
|
addstr("what scale? ");
|
||||||
addstr(get_helplist());
|
addstr(get_helplist());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
#include "convtbl.h"
|
#include "convtbl.h"
|
||||||
|
|
||||||
/* Column numbers */
|
/* Column numbers */
|
||||||
|
|
||||||
#define C1 0 /* 0-19 */
|
#define C1 0 /* 0-19 */
|
||||||
#define C2 20 /* 20-39 */
|
#define C2 20 /* 20-39 */
|
||||||
@ -121,9 +121,9 @@ static u_int getifnum(void);
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define DOPUTTOTAL(c, r, d) do { \
|
#define DOPUTTOTAL(c, r, d) do { \
|
||||||
CLEAR_COLUMN((r), (c)); \
|
CLEAR_COLUMN((r), (c)); \
|
||||||
mvprintw((r), (c), "%12.3f %s ", \
|
mvprintw((r), (c), "%12.3f %s ", \
|
||||||
convert(d##_##c, SC_AUTO), \
|
convert(d##_##c, SC_AUTO), \
|
||||||
get_string(d##_##c, SC_AUTO)); \
|
get_string(d##_##c, SC_AUTO)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@ -255,8 +255,8 @@ fetchifstat(void)
|
|||||||
(void)getifmibdata(ifp->if_row, &ifp->if_mib);
|
(void)getifmibdata(ifp->if_row, &ifp->if_mib);
|
||||||
|
|
||||||
|
|
||||||
new_inb = ifp->if_mib.ifmd_data.ifi_ibytes;
|
new_inb = ifp->if_mib.ifmd_data.ifi_ibytes;
|
||||||
new_outb = ifp->if_mib.ifmd_data.ifi_obytes;
|
new_outb = ifp->if_mib.ifmd_data.ifi_obytes;
|
||||||
|
|
||||||
/* Display interface if it's received some traffic. */
|
/* Display interface if it's received some traffic. */
|
||||||
if (new_inb > 0 && old_inb == 0) {
|
if (new_inb > 0 && old_inb == 0) {
|
||||||
@ -269,9 +269,9 @@ fetchifstat(void)
|
|||||||
* for our current traffic rates, and while we're there,
|
* for our current traffic rates, and while we're there,
|
||||||
* see if we have new peak rates.
|
* see if we have new peak rates.
|
||||||
*/
|
*/
|
||||||
old_tv = ifp->tv;
|
old_tv = ifp->tv;
|
||||||
timersub(&new_tv, &old_tv, &tv);
|
timersub(&new_tv, &old_tv, &tv);
|
||||||
elapsed = tv.tv_sec + (tv.tv_usec * 1e-6);
|
elapsed = tv.tv_sec + (tv.tv_usec * 1e-6);
|
||||||
|
|
||||||
ifp->if_in_curtraffic = new_inb - old_inb;
|
ifp->if_in_curtraffic = new_inb - old_inb;
|
||||||
ifp->if_out_curtraffic = new_outb - old_outb;
|
ifp->if_out_curtraffic = new_outb - old_outb;
|
||||||
@ -281,8 +281,8 @@ fetchifstat(void)
|
|||||||
* and line, we divide by ``elapsed'' as this is likely
|
* and line, we divide by ``elapsed'' as this is likely
|
||||||
* to be more accurate.
|
* to be more accurate.
|
||||||
*/
|
*/
|
||||||
ifp->if_in_curtraffic /= elapsed;
|
ifp->if_in_curtraffic /= elapsed;
|
||||||
ifp->if_out_curtraffic /= elapsed;
|
ifp->if_out_curtraffic /= elapsed;
|
||||||
|
|
||||||
if (ifp->if_in_curtraffic > ifp->if_in_traffic_peak)
|
if (ifp->if_in_curtraffic > ifp->if_in_traffic_peak)
|
||||||
ifp->if_in_traffic_peak = ifp->if_in_curtraffic;
|
ifp->if_in_traffic_peak = ifp->if_in_curtraffic;
|
||||||
|
@ -47,76 +47,76 @@ static const char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93";
|
|||||||
int
|
int
|
||||||
keyboard(void)
|
keyboard(void)
|
||||||
{
|
{
|
||||||
char ch, line[80];
|
char ch, line[80];
|
||||||
int oldmask;
|
int oldmask;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
col = 0;
|
col = 0;
|
||||||
move(CMDLINE, 0);
|
move(CMDLINE, 0);
|
||||||
do {
|
do {
|
||||||
refresh();
|
refresh();
|
||||||
ch = getch();
|
ch = getch();
|
||||||
if (ch == ERR) {
|
if (ch == ERR) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (ch >= 'A' && ch <= 'Z')
|
if (ch >= 'A' && ch <= 'Z')
|
||||||
ch += 'a' - 'A';
|
ch += 'a' - 'A';
|
||||||
if (col == 0) {
|
if (col == 0) {
|
||||||
#define mask(s) (1 << ((s) - 1))
|
#define mask(s) (1 << ((s) - 1))
|
||||||
if (ch == CTRL('l')) {
|
if (ch == CTRL('l')) {
|
||||||
oldmask = sigblock(mask(SIGALRM));
|
oldmask = sigblock(mask(SIGALRM));
|
||||||
wrefresh(curscr);
|
wrefresh(curscr);
|
||||||
sigsetmask(oldmask);
|
sigsetmask(oldmask);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ch == CTRL('g')) {
|
if (ch == CTRL('g')) {
|
||||||
oldmask = sigblock(mask(SIGALRM));
|
oldmask = sigblock(mask(SIGALRM));
|
||||||
status();
|
status();
|
||||||
sigsetmask(oldmask);
|
sigsetmask(oldmask);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ch != ':')
|
if (ch != ':')
|
||||||
continue;
|
continue;
|
||||||
move(CMDLINE, 0);
|
move(CMDLINE, 0);
|
||||||
clrtoeol();
|
clrtoeol();
|
||||||
}
|
}
|
||||||
if (ch == erasechar() && col > 0) {
|
if (ch == erasechar() && col > 0) {
|
||||||
if (col == 1 && line[0] == ':')
|
if (col == 1 && line[0] == ':')
|
||||||
continue;
|
continue;
|
||||||
col--;
|
col--;
|
||||||
goto doerase;
|
goto doerase;
|
||||||
}
|
}
|
||||||
if (ch == CTRL('w') && col > 0) {
|
if (ch == CTRL('w') && col > 0) {
|
||||||
while (--col >= 0 && isspace(line[col]))
|
while (--col >= 0 && isspace(line[col]))
|
||||||
;
|
;
|
||||||
col++;
|
col++;
|
||||||
while (--col >= 0 && !isspace(line[col]))
|
while (--col >= 0 && !isspace(line[col]))
|
||||||
if (col == 0 && line[0] == ':')
|
if (col == 0 && line[0] == ':')
|
||||||
break;
|
break;
|
||||||
col++;
|
col++;
|
||||||
goto doerase;
|
goto doerase;
|
||||||
}
|
}
|
||||||
if (ch == killchar() && col > 0) {
|
if (ch == killchar() && col > 0) {
|
||||||
col = 0;
|
col = 0;
|
||||||
if (line[0] == ':')
|
if (line[0] == ':')
|
||||||
col++;
|
col++;
|
||||||
doerase:
|
doerase:
|
||||||
move(CMDLINE, col);
|
move(CMDLINE, col);
|
||||||
clrtoeol();
|
clrtoeol();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (isprint(ch) || ch == ' ') {
|
if (isprint(ch) || ch == ' ') {
|
||||||
line[col] = ch;
|
line[col] = ch;
|
||||||
mvaddch(CMDLINE, col, ch);
|
mvaddch(CMDLINE, col, ch);
|
||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
} while (col == 0 || (ch != '\r' && ch != '\n'));
|
} while (col == 0 || (ch != '\r' && ch != '\n'));
|
||||||
line[col] = '\0';
|
line[col] = '\0';
|
||||||
oldmask = sigblock(mask(SIGALRM));
|
oldmask = sigblock(mask(SIGALRM));
|
||||||
command(line + 1);
|
command(line + 1);
|
||||||
sigsetmask(oldmask);
|
sigsetmask(oldmask);
|
||||||
}
|
}
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* no representations about the suitability of this software for any
|
* no representations about the suitability of this software for any
|
||||||
* purpose. It is provided "as is" without express or implied
|
* purpose. It is provided "as is" without express or implied
|
||||||
* warranty.
|
* warranty.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
|
* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
|
||||||
* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* no representations about the suitability of this software for any
|
* no representations about the suitability of this software for any
|
||||||
* purpose. It is provided "as is" without express or implied
|
* purpose. It is provided "as is" without express or implied
|
||||||
* warranty.
|
* warranty.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
|
* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
|
||||||
* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
@ -128,7 +128,7 @@ closenetstat(WINDOW *w)
|
|||||||
lastrow--;
|
lastrow--;
|
||||||
p->ni_line = -1;
|
p->ni_line = -1;
|
||||||
}
|
}
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
wclear(w);
|
wclear(w);
|
||||||
wrefresh(w);
|
wrefresh(w);
|
||||||
delwin(w);
|
delwin(w);
|
||||||
|
@ -33,10 +33,10 @@
|
|||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
|
|
||||||
struct cmdtab {
|
struct cmdtab {
|
||||||
const char *c_name; /* command name */
|
const char *c_name; /* command name */
|
||||||
void (*c_refresh)(void); /* display refresh */
|
void (*c_refresh)(void); /* display refresh */
|
||||||
void (*c_fetch)(void); /* sets up data structures */
|
void (*c_fetch)(void); /* sets up data structures */
|
||||||
void (*c_label)(void); /* label display */
|
void (*c_label)(void); /* label display */
|
||||||
int (*c_init)(void); /* initialize namelist, etc. */
|
int (*c_init)(void); /* initialize namelist, etc. */
|
||||||
WINDOW *(*c_open)(void); /* open display */
|
WINDOW *(*c_open)(void); /* open display */
|
||||||
void (*c_close)(WINDOW *); /* close display */
|
void (*c_close)(WINDOW *); /* close display */
|
||||||
|
@ -224,7 +224,7 @@ initkre(void)
|
|||||||
intrloc = calloc(nintr, sizeof (long));
|
intrloc = calloc(nintr, sizeof (long));
|
||||||
intrname = calloc(nintr, sizeof (char *));
|
intrname = calloc(nintr, sizeof (char *));
|
||||||
intrnamebuf = sysctl_dynread("hw.intrnames", NULL);
|
intrnamebuf = sysctl_dynread("hw.intrnames", NULL);
|
||||||
if (intrnamebuf == NULL || intrname == NULL ||
|
if (intrnamebuf == NULL || intrname == NULL ||
|
||||||
intrloc == NULL) {
|
intrloc == NULL) {
|
||||||
error("Out of memory");
|
error("Out of memory");
|
||||||
if (intrnamebuf)
|
if (intrnamebuf)
|
||||||
@ -854,7 +854,7 @@ dinfo(int dn, int lc, struct statinfo *now, struct statinfo *then)
|
|||||||
elapsed_time = now->snap_time - then->snap_time;
|
elapsed_time = now->snap_time - then->snap_time;
|
||||||
} else {
|
} else {
|
||||||
/* Calculate relative to device creation */
|
/* Calculate relative to device creation */
|
||||||
elapsed_time = now->snap_time - devstat_compute_etime(
|
elapsed_time = now->snap_time - devstat_compute_etime(
|
||||||
&now->dinfo->devices[di].creation_time, NULL);
|
&now->dinfo->devices[di].creation_time, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user