From dc7daa550af74277b10e8025d836fd5da48513f6 Mon Sep 17 00:00:00 2001 From: Albert Strasheim Date: Sun, 7 Apr 2013 11:16:15 -0700 Subject: [PATCH] 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 --- src/lib9/tempdir_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.50.0