]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Register debug_end as an exit function instead 279/head
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Mon, 27 Aug 2018 17:25:55 +0000 (19:25 +0200)
committerAnders F Björklund <anders.f.bjorklund@gmail.com>
Mon, 27 Aug 2018 17:29:17 +0000 (19:29 +0200)
src/ccache.c

index 3cf5d38219791182f7bff894b10a5e23b9e63028..28046a0f8e3a857dd208068d910ae50111e56bc9 100644 (file)
@@ -2070,10 +2070,6 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest)
                break;
        }
 
-       if (conf->debug) {
-               debug_end();
-       }
-
        // And exit with the right status code.
        x_exit(0);
 }
@@ -3385,6 +3381,7 @@ ccache(int argc, char *argv[])
 
        if (conf->debug) {
                debug_start(output_obj);
+               exitfn_add_nullary(debug_end);
        }
 
        struct mdfour common_hash;
@@ -3470,10 +3467,6 @@ ccache(int argc, char *argv[])
        // Run real compiler, sending output to cache.
        to_cache(compiler_args);
 
-       if (conf->debug) {
-               debug_end();
-       }
-
        x_exit(0);
 }