aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2019-12-19 14:51:18 -0500
committerRuss Cox <rsc@swtch.com>2019-12-19 14:51:49 -0500
commit0b349f6f34f1fff58ab9748277a093f70df2be33 (patch)
tree31a1dc8db714a321b298bc26c488aeecdda36df9 /src/cmd/acme
parent4af8158b5351cc0ed7fc0ebb5e7b31c64069363d (diff)
downloadplan9port-0b349f6f34f1fff58ab9748277a093f70df2be33.tar.gz
plan9port-0b349f6f34f1fff58ab9748277a093f70df2be33.tar.bz2
plan9port-0b349f6f34f1fff58ab9748277a093f70df2be33.zip
acme: report close failure during Put
Diffstat (limited to 'src/cmd/acme')
-rw-r--r--src/cmd/acme/exec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c
index ff491601..1d50f92f 100644
--- a/src/cmd/acme/exec.c
+++ b/src/cmd/acme/exec.c
@@ -699,7 +699,7 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
Rune *r;
Biobuf *b;
char *s, *name;
- int i, fd, q;
+ int i, fd, q, ret;
Dir *d, *d1;
Window *w;
int isapp;
@@ -762,9 +762,13 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
warning(nil, "can't write file %s: %r\n", name);
goto Rescue2;
}
- Bterm(b);
+ ret = Bterm(b);
free(b);
b = nil;
+ if(ret < 0) {
+ warning(nil, "can't write file %s: %r\n", name);
+ goto Rescue2; // flush or close failed
+ }
if(runeeq(namer, nname, f->name, f->nname)){
if(q0!=0 || q1!=f->b.nc){
f->mod = TRUE;