diff options
author | trasz <trasz@FreeBSD.org> | 2014-11-21 12:35:18 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-11-21 12:35:18 +0000 |
commit | a2fcd431540abce5510a48a6760b895eb3274a82 (patch) | |
tree | ecbd81e68def11ff1c61e55d02509496b8a36a01 /usr.sbin | |
parent | 2aadb1a5367b1b0d1a92611bab505d6a069a2e42 (diff) | |
download | FreeBSD-src-a2fcd431540abce5510a48a6760b895eb3274a82.zip FreeBSD-src-a2fcd431540abce5510a48a6760b895eb3274a82.tar.gz |
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
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ctld/ctld.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index bbf8e7d..529131a 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -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++; + */ + } + } } /* |