From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 12:35:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 034D9E3F; Fri, 21 Nov 2014 12:35:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E43C9A80; Fri, 21 Nov 2014 12:35:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALCZIB5091559; Fri, 21 Nov 2014 12:35:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALCZIL0091557; Fri, 21 Nov 2014 12:35:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411211235.sALCZIL0091557@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 21 Nov 2014 12:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274791 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 12:35:19 -0000 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++; + */ + } + } } /*