Skip to content

Commit f4570bb

Browse files
committed
cmd/makemac: report error if filesystem is read-only
Fixes golang/go#32449 Change-Id: I35d059778ab96ef4d57236aaccb41698314d6fac Reviewed-on: https://go-review.googlesource.com/c/build/+/202822 Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 5ac7036 commit f4570bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/makemac/makemac.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,15 +585,23 @@ func autoAdjust() {
585585
ctx, cancel := context.WithTimeout(context.Background(), autoAdjustTimeout)
586586
defer cancel()
587587

588+
ro := isFileSystemReadOnly()
589+
588590
st, err := getState(ctx)
589591
if err != nil {
590592
status.Lock()
593+
if ro {
594+
status.errors = append(status.errors, "Host filesystem is read-only")
595+
}
591596
status.errors = []string{err.Error()}
592597
status.Unlock()
593598
log.Print(err)
594599
return
595600
}
596601
var warnings, errors []string
602+
if ro {
603+
errors = append(errors, "Host filesystem is read-only")
604+
}
597605
defer func() {
598606
// Set status.lastState once we're now longer using it.
599607
if st != nil {

0 commit comments

Comments
 (0)