mirror of
https://github.com/golang/go
synced 2024-11-25 03:47:57 -07:00
cmd/dist: join with TMPDIR more carefully to avoid // in path.
This might fix the mkdtemp problem on the darwin builders if they have TMPDIR set to a path ending in a slash; at worse this will result in cleaner path names. R=golang-dev, r CC=golang-dev https://golang.org/cl/13097043
This commit is contained in:
parent
a07c95a53c
commit
24f302a69d
4
src/cmd/dist/unix.c
vendored
4
src/cmd/dist/unix.c
vendored
@ -466,7 +466,9 @@ xworkdir(void)
|
||||
xgetenv(&b, "TMPDIR");
|
||||
if(b.len == 0)
|
||||
bwritestr(&b, "/var/tmp");
|
||||
bwritestr(&b, "/go-cbuild-XXXXXX");
|
||||
if(b.p[b.len-1] != '/')
|
||||
bwrite(&b, "/", 1);
|
||||
bwritestr(&b, "go-cbuild-XXXXXX");
|
||||
p = bstr(&b);
|
||||
if(mkdtemp(p) == nil)
|
||||
fatal("mkdtemp(%s): %s", p, strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user