]> Cypherpunks repositories - gostls13.git/commit
gofmt: race condition in error reporting and setting exit code
authorFazlul Shahriar <fshahriar@gmail.com>
Wed, 2 Dec 2009 21:02:42 +0000 (13:02 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 2 Dec 2009 21:02:42 +0000 (13:02 -0800)
commit0aa13c999b9c419d1d857db0f08e77c4a5d26a4a
tree91cc098d9ba735b3ebc22a12d4a98c43da9a23f6
parentd8bc797ed5f7e97706d59616dabd1ede4a72878c
gofmt: race condition in error reporting and setting exit code

How to reproduce:

$ mkdir /tmp/foo
$ cp /dev/null /tmp/foo/bar.go
$ chmod -r /tmp/foo/bar.go
$ gofmt /tmp/foo
open /tmp/foo/bar.go: permission denied
$ echo $? # should echo 2
0
$

Maybe you need to put a call to time.Sleep at the beginning of report().

R=gri
CC=golang-dev
https://golang.org/cl/164073
src/cmd/gofmt/gofmt.go