]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Clean up dead code flagged by cppcheck and clang-analyzer
authorVille Skyttä <ville.skytta@iki.fi>
Sat, 28 Dec 2013 20:05:33 +0000 (22:05 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 13 Apr 2014 19:21:17 +0000 (21:21 +0200)
util.c

diff --git a/util.c b/util.c
index c52a8f65f87e549ef62818a1fc96b8753ee7732e..ed470d2c3d376b1a46bf0eaafcf52f1f88039974 100644 (file)
--- a/util.c
+++ b/util.c
@@ -184,7 +184,7 @@ mkstemp(char *template)
 int
 copy_file(const char *src, const char *dest, int compress_dest)
 {
-       int fd_in = -1, fd_out = -1;
+       int fd_in, fd_out;
        gzFile gz_in = NULL, gz_out = NULL;
        char buf[10240];
        int n, written;
@@ -1141,13 +1141,6 @@ x_readlink(const char *path)
        long maxlen = path_max(path);
        ssize_t len;
        char *buf;
-#ifdef PATH_MAX
-       maxlen = PATH_MAX;
-#elif defined(MAXPATHLEN)
-       maxlen = MAXPATHLEN;
-#elif defined(_PC_PATH_MAX)
-       maxlen = pathconf(path, _PC_PATH_MAX);
-#endif
        if (maxlen < 4096) maxlen = 4096;
 
        buf = x_malloc(maxlen);
@@ -1185,7 +1178,6 @@ read_file(const char *path, size_t size_hint, char **data, size_t *size)
        }
        allocated = size_hint;
        *data = x_malloc(allocated);
-       ret = 0;
        while (true) {
                if (pos > allocated / 2) {
                        allocated *= 2;