]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Simplify result_name_from_depfile signature
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 13 Feb 2020 20:32:07 +0000 (21:32 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 13 Feb 2020 20:56:13 +0000 (21:56 +0100)
src/ccache.cpp

index dd58453c0ac4bd825a76ad246b4c3662b6a1d33d..3405ea9414a526e07b4b9fdba5a0e0b392429912 100644 (file)
@@ -998,11 +998,13 @@ out:
 // Extract the used includes from the dependency file. Note that we cannot
 // distinguish system headers from other includes here.
 static struct digest*
-result_name_from_depfile(Context& ctx, const char* depfile, struct hash* hash)
+result_name_from_depfile(Context& ctx, struct hash* hash)
 {
-  FILE* f = fopen(depfile, "r");
+  FILE* f = fopen(ctx.args_info.output_dep.c_str(), "r");
   if (!f) {
-    cc_log("Cannot open dependency file %s: %s", depfile, strerror(errno));
+    cc_log("Cannot open dependency file %s: %s",
+           ctx.args_info.output_dep.c_str(),
+           strerror(errno));
     return NULL;
   }
 
@@ -1301,8 +1303,8 @@ to_cache(Context& ctx,
   }
 
   if (g_config.depend_mode()) {
-    struct digest* result_name = result_name_from_depfile(
-      ctx, ctx.args_info.output_dep.c_str(), depend_mode_hash);
+    struct digest* result_name =
+      result_name_from_depfile(ctx, depend_mode_hash);
     if (!result_name) {
       stats_update(STATS_ERROR);
       failed();