From 1cfa5958f0ab841bd00fcc0d674bfec87e2055bd Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 29 Sep 2014 13:28:08 -0700 Subject: [PATCH] undo CL 141840043 / 65e21380cb2a MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Unnecessary; covered by https://golang.org/cl/141690043 Verified by jonathan@titanous.com on golang-dev. ««« original CL description cmd/ld: close outfile before cleanup This prevents the temporary directory from being leaked when the linker is run on a FUSE filesystem. Fixes #8684. LGTM=bradfitz R=golang-codereviews, rsc, bradfitz CC=golang-codereviews https://golang.org/cl/141840043 »»» LGTM=jonathan, iant R=iant, jonathan CC=golang-codereviews https://golang.org/cl/150250045 --- src/cmd/ld/lib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c index 910201bdbb..f889aba8a9 100644 --- a/src/cmd/ld/lib.c +++ b/src/cmd/ld/lib.c @@ -531,9 +531,8 @@ char* mktempdir(void); void removeall(char*); static void -cleanup(void) +rmtemp(void) { - close(cout); removeall(tmpdir); } @@ -548,7 +547,7 @@ hostlinksetup(void) // create temporary directory and arrange cleanup if(tmpdir == nil) { tmpdir = mktempdir(); - atexit(cleanup); + atexit(rmtemp); } // change our output to temporary object file -- 2.50.0