diff options
| author | Albert Strasheim <fullung@gmail.com> | 2013-04-07 11:16:15 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2013-04-07 11:16:15 -0700 |
| commit | dc7daa550af74277b10e8025d836fd5da48513f6 (patch) | |
| tree | 899ad3f9b450b23895b2940a1bc6412247c3c812 /src/lib9/tempdir_unix.c | |
| parent | 114f20532e5f360a8738bfd7ab58dbd8d9f6ca98 (diff) | |
| download | go-git-dc7daa550af74277b10e8025d836fd5da48513f6.tar.gz | |
lib9: handle empty TMPDIR more gracefully.
Before, an empty TMPDIR would lead to:
cannot create <nil>/go.o: No such file or directory
R=golang-dev, iant, dave, bradfitz
CC=golang-dev
https://golang.org/cl/8355045
Diffstat (limited to 'src/lib9/tempdir_unix.c')
| -rw-r--r-- | src/lib9/tempdir_unix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib9/tempdir_unix.c b/src/lib9/tempdir_unix.c index 7b7e58b4d0..99a7092b68 100644 --- a/src/lib9/tempdir_unix.c +++ b/src/lib9/tempdir_unix.c @@ -16,7 +16,7 @@ mktempdir(void) char *tmp, *p; tmp = getenv("TMPDIR"); - if(tmp == nil) + if(tmp == nil || strlen(tmp) == 0) tmp = "/var/tmp"; p = smprint("%s/go-link-XXXXXX", tmp); if(mkdtemp(p) == nil) |
