]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Clean up
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 11 Jan 2018 13:41:51 +0000 (14:41 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 11 Jan 2018 20:05:13 +0000 (21:05 +0100)
ccache.c
ccache.h
util.c

index fcd0f215476a387e3dbf254642228b9ea6a684f5..e30bb50f1d1eafece13a695b715bae61db4defd9 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1639,13 +1639,13 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
                hash_int(hash, MANIFEST_VERSION);
        }
 
-       // clang will emit warnings for unused linker flags, so we shouldn't
-       // skip those arguments
+       // clang will emit warnings for unused linker flags, so we shouldn't skip
+       // those arguments.
        int is_clang = compiler_is_clang(args);
 
        // First the arguments.
        for (int i = 1; i < args->argc; i++) {
-               // -L doesn't affect compilation.
+               // -L doesn't affect compilation (except for clang).
                if (i < args->argc-1 && str_eq(args->argv[i], "-L") && !is_clang) {
                        i++;
                        continue;
@@ -1654,9 +1654,8 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
                        continue;
                }
 
-               // -Wl,... doesn't affect compilation.
+               // -Wl,... doesn't affect compilation (except for clang).
                if (str_startswith(args->argv[i], "-Wl,") && !is_clang) {
-                       // ...but it affects warnings with clang
                        continue;
                }
 
index 2a0a095e61fbb5dda3f6f06b725c7c80ad7382f5..229f8b4ac83f3a0ee432f00548afc6b7d634af85 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -184,7 +184,7 @@ char *x_readlink(const char *path);
 bool read_file(const char *path, size_t size_hint, char **data, size_t *size);
 char *read_text_file(const char *path, size_t size_hint);
 char *subst_env_in_string(const char *str, char **errmsg);
-void set_cloexec_flag (int fd);
+void set_cloexec_flag(int fd);
 
 // ----------------------------------------------------------------------------
 // stats.c
diff --git a/util.c b/util.c
index 9d3bba8c8d46712ea0faef8a61ee8080c8060a33..92bebcebd2afdd67e23f19a1f40ea9d267ae6357 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,5 +1,5 @@
 // Copyright (C) 2002 Andrew Tridgell
-// Copyright (C) 2009-2016 Joel Rosdahl
+// Copyright (C) 2009-2018 Joel Rosdahl
 //
 // This program is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by the Free
@@ -50,8 +50,7 @@ init_log(void)
        logfile = fopen(conf->log_file, "a");
        if (logfile) {
 #ifndef _WIN32
-               int fd = fileno(logfile);
-                set_cloexec_flag(fd);
+               set_cloexec_flag(fileno(logfile));
 #endif
                return true;
        } else {
@@ -1662,7 +1661,7 @@ subst_env_in_string(const char *str, char **errmsg)
 }
 
 void
-set_cloexec_flag (int fd)
+set_cloexec_flag(int fd)
 {
 #ifndef _WIN32
        int flags = fcntl(fd, F_GETFD, 0);
@@ -1671,4 +1670,3 @@ set_cloexec_flag (int fd)
        }
 #endif
 }
-