]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix broken UNCACHED_ERR_FD
authorLuboš Luňák <l.lunak@centrum.cz>
Fri, 26 Jan 2018 07:47:30 +0000 (08:47 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 28 Jan 2018 13:56:13 +0000 (14:56 +0100)
It shouldn't be closed on exec since that's exactly the point, to leak
it to whatever ccache calls.

ccache.c

index 3044016c23a531529804db52425caadb58c25356..d863a5a9d3c8d29d11fc63272bd759aacc7de542 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -3138,11 +3138,11 @@ static void
 setup_uncached_err(void)
 {
        int uncached_fd = dup(2);
-       set_cloexec_flag(uncached_fd);
        if (uncached_fd == -1) {
                cc_log("dup(2) failed: %s", strerror(errno));
                failed();
        }
+       // Leak the file descriptor.
 
        // Leak a pointer to the environment.
        char *buf = format("UNCACHED_ERR_FD=%d", uncached_fd);