summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2018-01-11 14:41:51 +0100
committerJoel Rosdahl <joel@rosdahl.net>2018-01-11 21:05:13 +0100
commitfac1597a7abbac7046926bc75dadcfa275aec01a (patch)
treecf4efdc35fb4311932244138b072a0a4d1dd63f1
parentf2e50e0448bf8c9a38b2d8e81dfe9375def20668 (diff)
downloadccache-fac1597a7abbac7046926bc75dadcfa275aec01a.tar.gz
Clean up
-rw-r--r--ccache.c9
-rw-r--r--ccache.h2
-rw-r--r--util.c8
3 files changed, 8 insertions, 11 deletions
diff --git a/ccache.c b/ccache.c
index fcd0f215..e30bb50f 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 2a0a095e..229f8b4a 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 9d3bba8c..92bebceb 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
}
-