Commit dc7daa55 authored by Albert Strasheim's avatar Albert Strasheim Committed by Brad Fitzpatrick

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
parent 114f2053
...@@ -16,7 +16,7 @@ mktempdir(void) ...@@ -16,7 +16,7 @@ mktempdir(void)
char *tmp, *p; char *tmp, *p;
tmp = getenv("TMPDIR"); tmp = getenv("TMPDIR");
if(tmp == nil) if(tmp == nil || strlen(tmp) == 0)
tmp = "/var/tmp"; tmp = "/var/tmp";
p = smprint("%s/go-link-XXXXXX", tmp); p = smprint("%s/go-link-XXXXXX", tmp);
if(mkdtemp(p) == nil) if(mkdtemp(p) == nil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment