Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Feb 2011 14:09:20 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218375 - head/sbin/hastd
Message-ID:  <201102061409.p16E9KRa067387@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102061409.p16E9KRa067387>