mirror of
https://github.com/golang/go.git
synced 2025-10-19 11:03:18 +00:00
cmd/compile/internal/gc: handle errors from *bio.Writer
Change-Id: I425b5d16149a7a40d888a1ab723b3642eb08224f
This commit is contained in:
parent
215de81513
commit
a5d3622331
2 changed files with 10 additions and 2 deletions
|
@ -47,5 +47,7 @@ func dumpasmhdr() {
|
|||
}
|
||||
}
|
||||
|
||||
b.Close()
|
||||
if err := b.Close(); err != nil {
|
||||
base.Fatalf("%v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ func dumpobj1(outfile string, mode int) {
|
|||
fmt.Printf("can't create %s: %v\n", outfile, err)
|
||||
base.ErrorExit()
|
||||
}
|
||||
defer bout.Close()
|
||||
|
||||
bout.WriteString("!<arch>\n")
|
||||
|
||||
if mode&modeCompilerObj != 0 {
|
||||
|
@ -70,6 +70,12 @@ func dumpobj1(outfile string, mode int) {
|
|||
dumpLinkerObj(bout)
|
||||
finishArchiveEntry(bout, start, "_go_.o")
|
||||
}
|
||||
|
||||
if err := bout.Close(); err != nil {
|
||||
base.FlushErrors()
|
||||
fmt.Printf("error while writing to file %s: %v\n", outfile, err)
|
||||
base.ErrorExit()
|
||||
}
|
||||
}
|
||||
|
||||
func printObjHeader(bout *bio.Writer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue