diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 07975f3568e..69523c9803a 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -111,14 +111,6 @@ main(argc, argv) error("%s", errbuf); exit(1); } - if (kvm_nlist(kd, namelist)) { - nlisterr(namelist); - exit(1); - } - if (namelist[X_FIRST].n_type == 0) { - fprintf(stderr, "couldn't read namelist.\n"); - exit(1); - } signal(SIGINT, die); signal(SIGQUIT, die); signal(SIGTERM, die); @@ -141,6 +133,14 @@ main(argc, argv) fprintf(stderr, "Couldn't set up load average window.\n"); die(0); } + if (kvm_nlist(kd, namelist)) { + nlisterr(namelist); + exit(1); + } + if (namelist[X_FIRST].n_type == 0) { + fprintf(stderr, "couldn't read namelist.\n"); + exit(1); + } gethostname(hostname, sizeof (hostname)); NREAD(X_HZ, &hz, LONG); NREAD(X_STATHZ, &stathz, LONG);