]> gitweb.factorcode.org Git - factor.git/commitdiff
fix file-system-info on linux
authorerg <erg@ubuntubox.(none)>
Mon, 1 Dec 2008 22:28:22 +0000 (16:28 -0600)
committererg <erg@ubuntubox.(none)>
Mon, 1 Dec 2008 22:28:22 +0000 (16:28 -0600)
basis/io/unix/files/linux/linux.factor
basis/unix/statfs/linux/linux.factor
basis/unix/statvfs/linux/linux.factor

index 584015711f8d1ed24bcd99679a0bfca259ef1c5a..dd9abcbd1ec0029fd94156a80f7fada926ff3df3 100644 (file)
@@ -1,12 +1,15 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-
+USING: accessors alien.c-types alien.syntax combinators csv
+io.encodings.utf8 io.files io.streams.string io.unix.files
+kernel namespaces sequences system unix unix.statfs.linux
+unix.statvfs.linux ;
 IN: io.unix.files.linux
 
 TUPLE: linux-file-system-info < unix-file-system-info
 namelen spare ;
 
-M: linux new-file-system-info unix-file-system-info new ;
+M: linux new-file-system-info linux-file-system-info new ;
 
 M: linux file-system-statfs ( path -- byte-array )
     "statfs64" <c-object> tuck statfs64 io-error ;
@@ -35,16 +38,6 @@ M: linux statvfs>file-system-info ( struct -- statfs )
         [ statvfs64-f_namemax >>name-max ]
     } cleave ;
 
-M: linux file-systems
-    parse-mtab [
-        [ mount-point>> file-system-info ] keep
-        {
-            [ file-system-name>> >>device-name ]
-            [ mount-point>> >>mount-point ]
-            [ type>> >>type ]
-        } cleave
-    ] map ;
-
 TUPLE: mtab-entry file-system-name mount-point type options
 frequency pass-number ;
 
@@ -65,3 +58,13 @@ frequency pass-number ;
         CHAR: \s delimiter set csv
     ] with-scope
     [ mtab-csv>mtab-entry ] map ;
+
+M: linux file-systems
+    parse-mtab [
+        [ mount-point>> file-system-info ] keep
+        {
+            [ file-system-name>> >>device-name ]
+            [ mount-point>> >>mount-point ]
+            [ type>> >>type ]
+        } cleave
+    ] map ;
index eb587e32864a1105a183bf5f59029fdbbb8cf5db..6550ee572e023926968ec997fff99b28e434ec39 100644 (file)
@@ -1,9 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.c-types combinators kernel unix.stat
-math accessors system unix io.backend layouts vocabs.loader
-sequences csv io.streams.string io.encodings.utf8 namespaces
-unix.statfs io.files ;
+USING: alien.syntax ;
 IN: unix.statfs.linux
 
 C-STRUCT: statfs64
index 008692a501cc08fe89cc913dc78e4754aa38c9db..3bfbffa197f88e4e1b6d17a63015debd820cf910 100644 (file)
@@ -14,7 +14,7 @@ C-STRUCT: statvfs64
     { "__fsfilcnt64_t" "f_favail" }
     { "ulong" "f_fsid" }
     { "ulong" "f_flag" }
-    { "ulong" f_namemax" }
+    { "ulong" "f_namemax" }
     { { "int" 6 } "__f_spare" } ;
 
 FUNCTION: int statvfs64 ( char* path, statvfs64* buf ) ;