summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-02-06 14:09:19 +0000
committerpjd <pjd@FreeBSD.org>2011-02-06 14:09:19 +0000
commit9904d3cd8237338ef48091569b19e05da7af9b77 (patch)
treed65a9f9b62f6497764565cb5b46078600dd155eb
parent8d12ba19c5155733b69e13b3312f9d22506d427b (diff)
downloadFreeBSD-src-9904d3cd8237338ef48091569b19e05da7af9b77.zip
FreeBSD-src-9904d3cd8237338ef48091569b19e05da7af9b77.tar.gz
Add (void) cast before snprintf(3)s for which we are not interested in return
values. MFC after: 1 week
-rw-r--r--sbin/hastd/hastd.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c
index eccce47..1183f89 100644
--- a/sbin/hastd/hastd.c
+++ b/sbin/hastd/hastd.c
@@ -185,7 +185,7 @@ descriptors_assert(const struct hast_resource *res, int pjdlogmode)
} 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_resource *res, int pjdlogmode)
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_resource *res, int pjdlogmode)
}
} 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_resource *res, int pjdlogmode)
} 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_resource *res, int pjdlogmode)
} 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;
OpenPOWER on IntegriCloud