diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2018-01-11 14:41:51 +0100 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2018-01-11 21:05:13 +0100 |
commit | fac1597a7abbac7046926bc75dadcfa275aec01a (patch) | |
tree | cf4efdc35fb4311932244138b072a0a4d1dd63f1 | |
parent | f2e50e0448bf8c9a38b2d8e81dfe9375def20668 (diff) | |
download | ccache-fac1597a7abbac7046926bc75dadcfa275aec01a.tar.gz |
Clean up
-rw-r--r-- | ccache.c | 9 | ||||
-rw-r--r-- | ccache.h | 2 | ||||
-rw-r--r-- | util.c | 8 |
3 files changed, 8 insertions, 11 deletions
@@ -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; } @@ -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 @@ -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 } - |