shithub: mc

Download patch

ref: 3bfbe159e8d71287487c01ce8791d70b554ac9df
parent: c49922d657525b5d78e69681c953c8c24a59ed2d
author: Ori Bernstein <[email protected]>
date: Mon Dec 29 18:26:46 EST 2014

Use Statprefixsz, not Statprefix. Also delete an unused struct.

--- a/libstd/syswrap+plan9.myr
+++ b/libstd/syswrap+plan9.myr
@@ -70,19 +70,7 @@
 
 
 const Statprefixsz = Stringsoff
-	
 
-type stathdr = struct
-	type	: uint16
-	devtype	: uint32
-	qid	: qid
-	mode	: uint32
-	atime	: uint32
-	mtime	: uint32
-	length	: off
-	/* we chop off the variable length data here */
-;;
-
 /* fd stuff */
 const open	= {path, opts;	-> sys.open(path, opts castto(sys.fdopt)) castto(fd)}
 const openmode	= {path, opts, mode;
@@ -120,9 +108,9 @@
 
 /* useful/portable bits of stat */
 const fmtime = {path
-	var buf	: byte[Statprefix]
+	var buf	: byte[Statprefixsz]
 
-	if sys.stat(path, buf[:]) < Statprefix
+	if sys.stat(path, buf[:]) < Statprefixsz
 		-> `None
 	;;
 	`Some getle32(buf[Mtimeoff:Lengthoff])
@@ -129,9 +117,9 @@
 }
 
 const fsize = {path
-	var buf	: byte[Statprefix]
+	var buf	: byte[Statprefixsz]
 
-	if sys.stat(path, buf[:]) < Statprefix
+	if sys.stat(path, buf[:]) < Statprefixsz
 		-> `None
 	;;
 	`Some getle64(buf[Lengthoff:Stringsoff])