]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
rtc_linux.c: Remove useless assignment `error = -1;`
authorPaul Menzel <paulepanter@users.sourceforge.net>
Thu, 3 Oct 2013 12:37:31 +0000 (14:37 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 7 Oct 2013 14:42:03 +0000 (16:42 +0200)
The Clang static analyzer scan-build from Debian clang version 3.4-1
found the following unneeded assignment.

        rtc_linux.c:756:5: warning: Value stored to 'error' is never read
            error = 1;
            ^       ~

Indeed, if in that if branch, the function returns without ever looking
at the variable `error`. So remove the line.

rtc_linux.c

index 9fe0ffb293e0ce6b643d01a322b61555c815a4cb..6e1771b45ef9aafe718035e7d958a2815e7412aa 100644 (file)
@@ -753,7 +753,6 @@ read_from_device(void *any)
     /* This looks like a bad error : the file descriptor was indicating it was
      * ready to read but we couldn't read anything.  Give up. */
     LOG(LOGS_ERR, LOGF_RtcLinux, "Could not read flags %s : %s", CNF_GetRtcDevice(), strerror(errno));
-    error = 1;
     SCH_RemoveInputFileHandler(fd);
     switch_interrupts(0); /* Likely to raise error too, but just to be sure... */
     close(fd);