]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: remove unnecessary void casts
authorSami Kerola <kerolasa@iki.fi>
Sun, 11 May 2014 19:26:43 +0000 (20:26 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 12 May 2014 11:07:12 +0000 (13:07 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/logger.c
term-utils/ttymsg.c

index b7f90649c742c7dccadee510b68e4fdd782c2540..a862e5523b6b1d59b68b1a1bd8a837d0e14b6805 100644 (file)
@@ -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",
index 8bf993c2fab949125546f38cd1f1c4e9e744d07d..fb2614ffd0494bcc226885aca9639153c7416a8e 100644 (file)
@@ -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;