]> Cypherpunks repositories - gostls13.git/commit
syscall: ignore getwd errors when fixing working directory on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Sat, 11 Apr 2015 12:58:42 +0000 (14:58 +0200)
committerDavid du Colombier <0intro@gmail.com>
Sun, 12 Apr 2015 17:37:30 +0000 (17:37 +0000)
commit7d3f81a9f330330fbfc50c3a511e95febb080194
tree492f1ea43f120b5ccb98d394cf9bc2cc5580ce72
parent63c16b1878497e807d0045064214e0e546c7be26
syscall: ignore getwd errors when fixing working directory on Plan 9

In Plan 9, goroutines can run in different processes,
which don't share their working directory. However,
Go expects the working directory to be program-wide.

We use a Fixwd function to fix the working directory
before calling system calls which depend on the
working directory.

In fixwdLocked, the working directory is not fixed
when getwd returns an error. However, an error can
happen is some cases, notably when the directory
has been previously removed in another process.

Fixes #10422.

Change-Id: Ie0c36f97c4b5ebe27ff0ead360987c5b35f825e4
Reviewed-on: https://go-review.googlesource.com/8800
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/syscall/pwd_plan9.go