diff options
author | grog <grog@FreeBSD.org> | 1999-04-17 04:11:48 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 1999-04-17 04:11:48 +0000 |
commit | cb6510d7954fcf64058408aa9e5d10e27822abc1 (patch) | |
tree | 11810e2719b3eba2632178822fb0a34377f15296 /sbin/vinum/commands.c | |
parent | a584a0422da4f1d7070b1c00f687626d777ad1c5 (diff) | |
download | FreeBSD-src-cb6510d7954fcf64058408aa9e5d10e27822abc1.zip FreeBSD-src-cb6510d7954fcf64058408aa9e5d10e27822abc1.tar.gz |
vinum_init: count dead children correctly when waiting for completion.
vinum_resetstats: count objects correctly.
Diffstat (limited to 'sbin/vinum/commands.c')
-rw-r--r-- | sbin/vinum/commands.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/vinum/commands.c b/sbin/vinum/commands.c index ded3f78..6bb5436 100644 --- a/sbin/vinum/commands.c +++ b/sbin/vinum/commands.c @@ -420,9 +420,12 @@ vinum_init(int argc, char *argv[], char *arg0[]) printf("couldn't fork for subdisk %d: %s", sdno, strerror(errno)); } /* Now wait for them to complete */ - for (sdno = 0; sdno < plex.subdisks; sdno++) { + while (1) { int status; pid = wait(&status); + if (((int) pid == -1) + && (errno == ECHILD)) /* all gone */ + break; if (WEXITSTATUS(status) != 0) { /* oh, oh */ printf("child %d exited with status 0x%x\n", pid, WEXITSTATUS(status)); failed++; @@ -761,7 +764,7 @@ vinum_resetstats(int argc, char *argv[], char *argv0[]) return; } if (argc == 0) { - for (objno = 0; objno < vinum_conf.volumes_used; objno++) + for (objno = 0; objno < vinum_conf.volumes_allocated; objno++) reset_volume_stats(objno, 1); /* clear everything recursively */ } else { for (i = 0; i < argc; i++) { |