mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
vinum_init: count dead children correctly when waiting for completion.
vinum_resetstats: count objects correctly.
This commit is contained in:
parent
2483cc6611
commit
409d8396f9
1 changed files with 5 additions and 2 deletions
|
|
@ -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++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue