shithub: mc

Download patch

ref: ede314eb86643c9d737f1fc66f8a14eb9b92fd69
parent: 199b9cbd18da9e32a3bacdee6266a098036b34be
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jan 16 10:06:03 EST 2016

update plan9 build with missing file

	We were missing dir+plan9.myr in the
	build. It had gotten out of sync, so
	this should fix it.

--- a/lib/std/bld.sub
+++ b/lib/std/bld.sub
@@ -81,6 +81,7 @@
 	dir+freebsd.myr
 	dir+linux.myr
 	dir+osx.myr
+	dir+plan9.myr
 	wait+posixy.myr
 	wait+plan9.myr
 	dial+posixy.myr
--- a/lib/std/dir+plan9.myr
+++ b/lib/std/dir+plan9.myr
@@ -26,9 +26,9 @@
 	var fd
 	var dir
 
-	fd = open(p, Ordonly)
-	if fd < 0
-		-> `Fail "couldn't open directory"
+	match open(p, Ordonly)
+	| `Ok f:	fd = f
+	| `Fail e:	-> `Fail "couldn't open directory"
 	;;
 
 	dir = zalloc()
@@ -38,16 +38,19 @@
 	
 
 const dirread = {d
-	var len : int64, name, base, namelen, dirlen
+	var name, base, namelen, dirlen
 
 	/* NB: On Plan 9, read(2) will always return whole directory entries */
 	if d.off >= d.len
-		len = read(d.fd, d.buf[:]) castto(int64)
-		if len <= 0
+		match read(d.fd, d.buf[:])
+		| `Ok 0:
 			-> `None
+		| `Fail e:
+			-> `None
+		| `Ok len:
+			d.len = len castto(int64)
+			d.off = 0
 		;;
-		d.len = len
-		d.off = 0
 	;;
 
 	namelen = (d.buf[d.off + Stringsoff] castto(int64)) | \