shithub: mc

Download patch

ref: b7747c5a3d36f99514b1945efb05b9f04f7dc74a
parent: b1c1b98b1c37378ae230705e55cf6abae8906407
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Apr 16 07:37:32 EDT 2015

Shuffle around files, remove redundant systags.

--- a/libstd/bld.sub
+++ b/libstd/bld.sub
@@ -29,8 +29,6 @@
 	clear.myr
 	cmp.myr
 	cstrconv.myr
-	dial+posixy.myr
-	dial+plan9.myr
 	die.myr
 	dirname.myr
 	endian.myr
@@ -58,8 +56,6 @@
 	pathjoin.myr
 	putint.myr
 	rand.myr
-	resolve+posixy.myr
-	resolve+plan9.myr
 	result.myr
 	search.myr
 	slcp.myr
@@ -76,10 +72,6 @@
 	strjoin.myr
 	strsplit.myr
 	strstrip.myr
-	syswrap+plan9.myr
-	syswrap-ss+posixy-linux.myr
-	syswrap-ss+posixy-osx.myr
-	syswrap+posixy.myr
 	swap.myr
 	try.myr
 	types.myr
@@ -93,4 +85,12 @@
 	dir+osx.myr
 	wait+posixy.myr
 	wait+plan9.myr
+	dial+posixy.myr
+	dial+plan9.myr
+	resolve+posixy.myr
+	resolve+plan9.myr
+	syswrap+plan9.myr
+	syswrap-ss+linux.myr
+	syswrap-ss+osx.myr
+	syswrap+posixy.myr
 ;;
--- /dev/null
+++ b/libstd/syswrap-ss+linux.myr
@@ -1,0 +1,22 @@
+use sys
+use "errno.use"
+
+pkg std =
+	const exit	: (status:int -> void)
+	pkglocal const bgetcwd	: (buf : byte[:] -> errno)
+;;
+
+const exit	= {status;	sys.exit_group(status)}
+const bgetcwd	= {buf;
+	var err
+	err = sys.getcwd(buf) castto(errno)
+	/*
+	if we got a length back, it includes
+	the nul byte. chop that off.
+	*/
+	if err > 0
+		-> err - 1
+	else
+		-> err
+	;;
+}
--- /dev/null
+++ b/libstd/syswrap-ss+osx.myr
@@ -1,0 +1,35 @@
+use sys
+use "errno.use"
+use "cstrconv.use"
+use "slcp.use"
+use "die.use"
+
+pkg std =
+	const exit	: (status:int -> void)
+	pkglocal const bgetcwd	: (buf : byte[:] -> errno)
+;;
+
+const exit	= {status;	sys.exit(status)}
+const bgetcwd	= {buf
+	var path : byte[sys.Maxpathlen]
+	var fd, len, err
+
+	fd = sys.open(".", sys.Ordonly)
+	if fd < 0
+		-> fd castto(errno)
+	;;
+	/* 
+	FIXME: if the path is longer than sys.Pathmax, we should fall back to
+	the ugly method of finding the path.
+	*/
+	err = sys.fcntl(fd, sys.Fgetpath, path[:] castto(byte#)) castto(errno)
+	if err < 0
+		-> err
+	;;
+	len = cstrlen(path[:])
+	if len >= buf.len
+		-> Erange
+	;;
+	slcp(buf[:len], path[:len])
+	-> len castto(errno)
+}
--- a/libstd/syswrap-ss+posixy-linux.myr
+++ /dev/null
@@ -1,22 +1,0 @@
-use sys
-use "errno.use"
-
-pkg std =
-	const exit	: (status:int -> void)
-	pkglocal const bgetcwd	: (buf : byte[:] -> errno)
-;;
-
-const exit	= {status;	sys.exit_group(status)}
-const bgetcwd	= {buf;
-	var err
-	err = sys.getcwd(buf) castto(errno)
-	/*
-	if we got a length back, it includes
-	the nul byte. chop that off.
-	*/
-	if err > 0
-		-> err - 1
-	else
-		-> err
-	;;
-}
--- a/libstd/syswrap-ss+posixy-osx.myr
+++ /dev/null
@@ -1,35 +1,0 @@
-use sys
-use "errno.use"
-use "cstrconv.use"
-use "slcp.use"
-use "die.use"
-
-pkg std =
-	const exit	: (status:int -> void)
-	pkglocal const bgetcwd	: (buf : byte[:] -> errno)
-;;
-
-const exit	= {status;	sys.exit(status)}
-const bgetcwd	= {buf
-	var path : byte[sys.Maxpathlen]
-	var fd, len, err
-
-	fd = sys.open(".", sys.Ordonly)
-	if fd < 0
-		-> fd castto(errno)
-	;;
-	/* 
-	FIXME: if the path is longer than sys.Pathmax, we should fall back to
-	the ugly method of finding the path.
-	*/
-	err = sys.fcntl(fd, sys.Fgetpath, path[:] castto(byte#)) castto(errno)
-	if err < 0
-		-> err
-	;;
-	len = cstrlen(path[:])
-	if len >= buf.len
-		-> Erange
-	;;
-	slcp(buf[:len], path[:len])
-	-> len castto(errno)
-}