Add missing error checking for kernel_port_{add,remove}(). Both can fail

for reasons yet unknown; don't make it increment cumulated_error as a kind
of temporary workaround.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2014-11-21 12:35:18 +00:00
parent c6ceed4f7a
commit e48bb73a2a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274791

View File

@ -1678,7 +1678,16 @@ conf_apply(struct conf *oldconf, struct conf *newconf)
cumulated_error++;
}
}
kernel_port_remove(oldtarg);
error = kernel_port_remove(oldtarg);
if (error != 0) {
log_warnx("failed to remove target %s",
oldtarg->t_name);
/*
* XXX: Uncomment after fixing the root cause.
*
* cumulated_error++;
*/
}
continue;
}
@ -1812,8 +1821,18 @@ conf_apply(struct conf *oldconf, struct conf *newconf)
cumulated_error++;
}
}
if (oldtarg == NULL)
kernel_port_add(newtarg);
if (oldtarg == NULL) {
error = kernel_port_add(newtarg);
if (error != 0) {
log_warnx("failed to add target %s",
oldtarg->t_name);
/*
* XXX: Uncomment after fixing the root cause.
*
* cumulated_error++;
*/
}
}
}
/*