From: Joel Rosdahl Date: Thu, 11 Jan 2018 13:41:51 +0000 (+0100) Subject: Clean up X-Git-Tag: v3.3.5~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fac1597a7abbac7046926bc75dadcfa275aec01a;p=thirdparty%2Fccache.git Clean up --- diff --git a/ccache.c b/ccache.c index fcd0f2154..e30bb50f1 100644 --- 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; } diff --git a/ccache.h b/ccache.h index 2a0a095e6..229f8b4ac 100644 --- 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 9d3bba8c8..92bebcebd 100644 --- 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 } -