From: Albert Strasheim Date: Sun, 7 Apr 2013 18:16:15 +0000 (-0700) Subject: lib9: handle empty TMPDIR more gracefully. X-Git-Tag: go1.1rc2~154 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=dc7daa550af74277b10e8025d836fd5da48513f6;p=gostls13.git lib9: handle empty TMPDIR more gracefully. Before, an empty TMPDIR would lead to: cannot create /go.o: No such file or directory R=golang-dev, iant, dave, bradfitz CC=golang-dev https://golang.org/cl/8355045 --- 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)