Skip to content

Commit

Permalink
cmd/makemac: report error if filesystem is read-only
Browse files Browse the repository at this point in the history
Fixes golang/go#32449

Change-Id: I35d059778ab96ef4d57236aaccb41698314d6fac
Reviewed-on: https://go-review.googlesource.com/c/build/+/202822
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
  • Loading branch information
bradfitz committed Oct 24, 2019
1 parent 5ac7036 commit f4570bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/makemac/makemac.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,15 +585,23 @@ func autoAdjust() {
ctx, cancel := context.WithTimeout(context.Background(), autoAdjustTimeout)
defer cancel()

ro := isFileSystemReadOnly()

st, err := getState(ctx)
if err != nil {
status.Lock()
if ro {
status.errors = append(status.errors, "Host filesystem is read-only")
}
status.errors = []string{err.Error()}
status.Unlock()
log.Print(err)
return
}
var warnings, errors []string
if ro {
errors = append(errors, "Host filesystem is read-only")
}
defer func() {
// Set status.lastState once we're now longer using it.
if st != nil {
Expand Down

0 comments on commit f4570bb

Please sign in to comment.