shithub: mc

Download patch

ref: 6982c1b3db08373d6ab71ad9b599a8937afaaba4
parent: 1288c9b1707bd4657305f241f62753630f852570
author: Ori Bernstein <[email protected]>
date: Mon Oct 6 14:34:12 EDT 2014

Fix osx libsys build.

--- a/libstd/dir+osx.myr
+++ b/libstd/dir+osx.myr
@@ -1,3 +1,5 @@
+use sys
+
 use "alloc.use"
 use "die.use"
 use "option.use"
@@ -4,12 +6,11 @@
 use "result.use"
 use "slcp.use"
 use "sldup.use"
-use "sys.use"
 use "types.use"
 
 pkg std =
 	type dir = struct
-		fd	: fd
+		fd	: sys.fd
 		buf	: byte[16384]
 		len	: int64
 		off	: int64
@@ -25,7 +26,7 @@
 	var fd
 	var dir
 
-	fd = open(p, Ordonly | Odir)
+	fd = sys.open(p, sys.Ordonly | sys.Odir)
 	if fd < 0
 		-> `Fail "couldn't open directory"
 	;;
@@ -39,7 +40,7 @@
 	var dent
 
 	if d.off >= d.len
-		len = getdirentries64(d.fd, d.buf[:], &d.base)
+		len = sys.getdirentries64(d.fd, d.buf[:], &d.base)
 		if len <= 0
 			-> `None
 		;;
@@ -47,13 +48,13 @@
 		d.off = 0
 	;;
 
-	dent = &d.buf[d.off] castto(dirent64#)
+	dent = &d.buf[d.off] castto(sys.dirent64#)
 	d.off += dent.reclen castto(int64)
 	-> `Some sldup(dent.name[:dent.namlen])
 }
 
 const dirclose = {d
-	close(d.fd)
+	sys.close(d.fd)
 	free(d)
 }
 
--- a/libstd/syswrap.myr
+++ b/libstd/syswrap.myr
@@ -10,7 +10,6 @@
 	const Owronly  	: fdopt = sys.Owronly	castto(fdopt)
 	const Ordwr    	: fdopt = sys.Ordwr	castto(fdopt)
 	const Ocreat   	: fdopt = sys.Ocreat	castto(fdopt)
-	const Oexcl  	: fdopt = sys.Oexcl	castto(fdopt)
 	const Otrunc   	: fdopt = sys.Otrunc	castto(fdopt)
 	const Oappend  	: fdopt = sys.Oappend	castto(fdopt)
 	const Odir	: fdopt = sys.Odir	castto(fdopt)