diff options
Diffstat (limited to 'src/pkg')
-rw-r--r-- | src/pkg/runtime/env_plan9.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/runtime/env_plan9.go b/src/pkg/runtime/env_plan9.go index b6dcb4c1e..76e9867e0 100644 --- a/src/pkg/runtime/env_plan9.go +++ b/src/pkg/runtime/env_plan9.go @@ -31,6 +31,10 @@ func gogetenv(key string) string { return "" } n := seek(fd, 0, 2) - 1 + if n <= 0 { + close(fd) + return "" + } p := make([]byte, n) |