From owner-svn-src-all@FreeBSD.ORG Sun Feb 6 14:09:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3580C1065670; Sun, 6 Feb 2011 14:09:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24ABE8FC14; Sun, 6 Feb 2011 14:09:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p16E9KhZ067389; Sun, 6 Feb 2011 14:09:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p16E9KRa067387; Sun, 6 Feb 2011 14:09:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201102061409.p16E9KRa067387@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 6 Feb 2011 14:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218375 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2011 14:09:20 -0000 Author: pjd Date: Sun Feb 6 14:09:19 2011 New Revision: 218375 URL: http://svn.freebsd.org/changeset/base/218375 Log: Add (void) cast before snprintf(3)s for which we are not interested in return values. MFC after: 1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Sun Feb 6 14:07:58 2011 (r218374) +++ head/sbin/hastd/hastd.c Sun Feb 6 14:09:19 2011 (r218375) @@ -185,7 +185,7 @@ descriptors_assert(const struct hast_res } else { isopen = true; /* silence gcc */ mode = 0; /* silence gcc */ - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Unable to fstat descriptor %d: %s", fd, strerror(errno)); break; @@ -193,7 +193,7 @@ descriptors_assert(const struct hast_res if (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO) { if (!isopen) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (%s) is closed, but should be open.", fd, (fd == STDIN_FILENO ? "stdin" : (fd == STDOUT_FILENO ? "stdout" : "stderr"))); @@ -201,39 +201,39 @@ descriptors_assert(const struct hast_res } } else if (fd == proto_descriptor(res->hr_event)) { if (!isopen) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (event) is closed, but should be open.", fd); break; } if (!S_ISSOCK(mode)) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (event) is %s, but should be %s.", fd, dtype2str(mode), dtype2str(S_IFSOCK)); break; } } else if (fd == proto_descriptor(res->hr_ctrl)) { if (!isopen) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (ctrl) is closed, but should be open.", fd); break; } if (!S_ISSOCK(mode)) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (ctrl) is %s, but should be %s.", fd, dtype2str(mode), dtype2str(S_IFSOCK)); break; } } else if (fd == proto_descriptor(res->hr_conn)) { if (!isopen) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (conn) is closed, but should be open.", fd); break; } if (!S_ISSOCK(mode)) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (conn) is %s, but should be %s.", fd, dtype2str(mode), dtype2str(S_IFSOCK)); break; @@ -241,13 +241,13 @@ descriptors_assert(const struct hast_res } else if (res->hr_role == HAST_ROLE_SECONDARY && fd == proto_descriptor(res->hr_remotein)) { if (!isopen) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (remote in) is closed, but should be open.", fd); break; } if (!S_ISSOCK(mode)) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (remote in) is %s, but should be %s.", fd, dtype2str(mode), dtype2str(S_IFSOCK)); break; @@ -255,20 +255,20 @@ descriptors_assert(const struct hast_res } else if (res->hr_role == HAST_ROLE_SECONDARY && fd == proto_descriptor(res->hr_remoteout)) { if (!isopen) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (remote out) is closed, but should be open.", fd); break; } if (!S_ISSOCK(mode)) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d (remote out) is %s, but should be %s.", fd, dtype2str(mode), dtype2str(S_IFSOCK)); break; } } else { if (isopen) { - snprintf(msg, sizeof(msg), + (void)snprintf(msg, sizeof(msg), "Descriptor %d is open (%s), but should be closed.", fd, dtype2str(mode)); break;