Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(815)

Issue 164073: code review 164073: gofmt: race condition in error reporting and setting ex... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 4 months ago by fhs
Modified:
15 years, 3 months ago
Reviewers:
gri
CC:
golang-dev
Visibility:
Public.

Description

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().

Patch Set 1 #

Patch Set 2 : code review 164073: gofmt: race condition in error reporting and setting ex... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M src/cmd/gofmt/gofmt.go View 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 3
fhs
Hello gri (cc: golang-dev@googlegroups.com), I'd like you to review the following change.
15 years, 4 months ago (2009-12-02 06:58:43 UTC) #1
gri
LGTM Good catch. Thank you!
15 years, 4 months ago (2009-12-02 20:56:28 UTC) #2
gri
15 years, 4 months ago (2009-12-02 21:02:43 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=8b6a929769a2 ***

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
http://codereview.appspot.com/164073

Committer: Robert Griesemer <gri@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b