• Brad Fitzpatrick's avatar
    syscall: make pwd process-wide on Plan 9 · bc9748ee
    Brad Fitzpatrick authored
    On Plan 9, the pwd is apparently per-thread not per process. That
    means different goroutines saw different current directories, even
    changing within a goroutine as they were scheduled.
    
    Instead, track the the process-wide pwd protected by a mutex in the
    syscall package and set the current goroutine thread's pwd to the
    correct once at critical points.
    
    Fixes #9428
    
    Change-Id: I928e90886355be4a95c2be834f5883e2b50fc0cf
    Reviewed-on: https://go-review.googlesource.com/6350Reviewed-by: 's avatarDavid du Colombier <0intro@gmail.com>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    bc9748ee
syscall_plan9.go 7.35 KB