git: 9front

Download patch

ref: 4971eecc88d79d818f87b25c1e8c1455ab56c2d7
parent: fd822b17728b02e1f4cc521f067ac16f26c4e233
author: aiju <aiju@phicode.de>
date: Mon Jul 25 14:51:15 EDT 2011

added read/write error handling to ed

--- a/sys/src/cmd/ed.c
+++ b/sys/src/cmd/ed.c
@@ -127,6 +127,7 @@
 	char *p1, *p2;
 
 	Binit(&bcons, 0, OREAD);
+	Blethal(&bcons, nil);
 	notify(notifyf);
 	ARGBEGIN {
 	case 'o':
@@ -322,6 +323,7 @@
 				free(d);
 			}
 			Binit(&iobuf, io, OREAD);
+			Blethal(&iobuf, nil);
 			setwide();
 			squeeze(0);
 			c = zero != dol;
@@ -370,6 +372,7 @@
 				if((io = create(file, OWRITE, 0666)) < 0)
 					error(file);
 			Binit(&iobuf, io, OWRITE);
+			Blethal(&iobuf, nil);
 			wrapp = 0;
 			if(dol > zero)
 				putfile();
@@ -669,6 +672,7 @@
 		io = create("ed.hup", OWRITE, 0666);
 		if(io > 0){
 			Binit(&iobuf, io, OWRITE);
+			Blethal(&iobuf, nil);
 			putfile();
 		}
 	}
--