Date: Fri, 21 Nov 2014 12:35:18 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274791 - head/usr.sbin/ctld Message-ID: <201411211235.sALCZIL0091557@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Fri Nov 21 12:35:18 2014 New Revision: 274791 URL: https://svnweb.freebsd.org/changeset/base/274791 Log: 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 Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Fri Nov 21 11:21:39 2014 (r274790) +++ head/usr.sbin/ctld/ctld.c Fri Nov 21 12:35:18 2014 (r274791) @@ -1678,7 +1678,16 @@ conf_apply(struct conf *oldconf, struct 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 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++; + */ + } + } } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411211235.sALCZIL0091557>