From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 06/12] build-sys: remove unnecessary void casts
Date: Sun, 11 May 2014 20:26:43 +0100 [thread overview]
Message-ID: <1399836409-7769-6-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1399836409-7769-1-git-send-email-kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
misc-utils/logger.c | 2 +-
term-utils/ttymsg.c | 26 +++++++++++++-------------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index b7f9064..a862e55 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -275,7 +275,7 @@ static void mysyslog(int fd, int logflags, int pri, char *tag, char *msg)
if (!cp)
cp = "<someone>";
}
- (void)time(&now);
+ time(&now);
tp = ctime(&now)+4;
snprintf(buf, sizeof(buf), "<%d>%.15s %.200s%s: %.400s",
diff --git a/term-utils/ttymsg.c b/term-utils/ttymsg.c
index 8bf993c..fb2614f 100644
--- a/term-utils/ttymsg.c
+++ b/term-utils/ttymsg.c
@@ -85,10 +85,10 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) {
also wrong since people use /dev/pts/xxx. */
if (strlen(line) + sizeof(_PATH_DEV) + 1 > sizeof(device)) {
- (void) sprintf(errbuf, _("excessively long line arg"));
+ sprintf(errbuf, _("excessively long line arg"));
return (errbuf);
}
- (void) sprintf(device, "%s%s", _PATH_DEV, line);
+ sprintf(device, "%s%s", _PATH_DEV, line);
/*
* open will fail on slip lines or exclusive-use lines
@@ -99,7 +99,7 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) {
return (NULL);
if (strlen(strerror(errno)) > 1000)
return (NULL);
- (void) sprintf(errbuf, "%s: %m", device);
+ sprintf(errbuf, "%s: %m", device);
errbuf[1024] = 0;
return (errbuf);
}
@@ -134,32 +134,32 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) {
sigset_t sigmask;
if (forked) {
- (void) close(fd);
+ close(fd);
_exit(EXIT_FAILURE);
}
cpid = fork();
if (cpid < 0) {
if (strlen(strerror(errno)) > 1000)
- (void) sprintf(errbuf, _("cannot fork"));
+ sprintf(errbuf, _("cannot fork"));
else {
errsv = errno;
- (void) sprintf(errbuf,
+ sprintf(errbuf,
_("fork: %s"), strerror(errsv));
}
- (void) close(fd);
+ close(fd);
return (errbuf);
}
if (cpid) { /* parent */
- (void) close(fd);
+ close(fd);
return (NULL);
}
forked++;
/* wait at most tmout seconds */
- (void) signal(SIGALRM, SIG_DFL);
- (void) signal(SIGTERM, SIG_DFL); /* XXX */
+ signal(SIGALRM, SIG_DFL);
+ signal(SIGTERM, SIG_DFL); /* XXX */
sigemptyset(&sigmask);
sigprocmask (SIG_SETMASK, &sigmask, NULL);
- (void) alarm((u_int)tmout);
+ alarm((u_int)tmout);
flags = fcntl(fd, F_GETFL);
fcntl(flags, F_SETFL, (long) (flags & ~O_NONBLOCK));
continue;
@@ -175,11 +175,11 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) {
if (forked)
_exit(EXIT_FAILURE);
if (strlen(strerror(errno)) > 1000)
- (void) sprintf(errbuf, _("%s: BAD ERROR, message is "
+ sprintf(errbuf, _("%s: BAD ERROR, message is "
"far too long"), device);
else {
errsv = errno;
- (void) sprintf(errbuf, "%s: %s", device,
+ sprintf(errbuf, "%s: %s", device,
strerror(errsv));
}
errbuf[1024] = 0;
--
1.9.2
next prev parent reply other threads:[~2014-05-11 19:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-11 19:26 [PATCH 01/12] tests: check /proc availability, and go-around if it is incomplete Sami Kerola
2014-05-11 19:26 ` [PATCH 02/12] cytune: remove from util-linux Sami Kerola
2014-05-12 12:11 ` Karel Zak
2014-05-11 19:26 ` [PATCH 03/12] blkid: remove unused variable Sami Kerola
2014-05-11 19:26 ` [PATCH 04/12] logger: fail when io vector number exceeds maximum Sami Kerola
2014-05-11 19:26 ` [PATCH 05/12] logger: check numeric priority and facility input values Sami Kerola
2014-05-11 19:26 ` Sami Kerola [this message]
2014-05-11 19:26 ` [PATCH 07/12] term-utils: avoid error message string length couting errors Sami Kerola
2014-05-12 12:05 ` Karel Zak
2014-05-11 19:26 ` [PATCH 08/12] wall: replace magic number by named value Sami Kerola
2014-05-11 19:26 ` [PATCH 09/12] setterm: remove unused code Sami Kerola
2014-05-11 19:26 ` [PATCH 10/12] setterm: use string constant rather than #define Sami Kerola
2014-05-12 12:07 ` Karel Zak
2014-05-11 19:26 ` [PATCH 11/12] setterm: convert various constant number definitions to enums Sami Kerola
2014-05-11 19:26 ` [PATCH 12/12] setterm: convert remaining magic values to symbolic references Sami Kerola
2014-05-12 12:10 ` Karel Zak
2014-05-12 14:53 ` Sami Kerola
2014-05-12 7:05 ` [PATCH 01/12] tests: check /proc availability, and go-around if it is incomplete Bernhard Voelker
2014-05-12 9:13 ` Sami Kerola
2014-05-12 11:06 ` Karel Zak
2014-05-12 12:01 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399836409-7769-6-git-send-email-kerolasa@iki.fi \
--to=kerolasa@iki.fi \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox