[Gd-chatter] r10742 - in trunk/fundev/sources/system: . file-system
andreas at gwydiondylan.org
andreas at gwydiondylan.org
Tue May 16 14:07:27 CEST 2006
Author: andreas
Date: Tue May 16 14:07:24 2006
New Revision: 10742
Modified:
trunk/fundev/sources/system/file-system/unix-ffi.dylan
trunk/fundev/sources/system/file-system/unix-file-system.dylan
trunk/fundev/sources/system/file-system/unix-interface.dylan
trunk/fundev/sources/system/library.dylan
Log:
job: fd
Fix errno() and lseek() on UNIX, un-breaking do-directory on the way.
Modified: trunk/fundev/sources/system/file-system/unix-ffi.dylan
==============================================================================
--- trunk/fundev/sources/system/file-system/unix-ffi.dylan (original)
+++ trunk/fundev/sources/system/file-system/unix-ffi.dylan Tue May 16 14:07:24 2006
@@ -189,11 +189,6 @@
raw-as-integer(unix-errno())
end function unix-last-error;
-define function unix-last-error-setter (errno :: <integer>) => (errno :: <integer>)
- unix-errno() := integer-as-raw(errno);
- errno
-end function unix-last-error-setter;
-
define function unix-last-error-message () => (message :: <string>)
let message :: <byte-string>
= primitive-raw-as-string
Modified: trunk/fundev/sources/system/file-system/unix-file-system.dylan
==============================================================================
--- trunk/fundev/sources/system/file-system/unix-file-system.dylan (original)
+++ trunk/fundev/sources/system/file-system/unix-file-system.dylan Tue May 16 14:07:24 2006
@@ -477,7 +477,6 @@
integer-as-raw($INVALID_DIRECTORY_FD)))
unix-file-error("start listing of", "%s", directory)
end;
- unix-last-error() := 0;
let dirent = primitive-wrap-machine-word
(primitive-cast-pointer-as-raw
(%call-c-function ("readdir")
@@ -498,7 +497,6 @@
filename,
type)
end;
- unix-last-error() := 0;
dirent := primitive-wrap-machine-word
(primitive-cast-pointer-as-raw
(%call-c-function ("readdir")
@@ -507,9 +505,13 @@
(primitive-unwrap-machine-word(directory-fd)))
end));
end;
- if (unix-last-error() ~= 0)
+/*
+ if (primitive-machine-word-equal?
+ (primitive-unwrap-machine-word(dirent),
+ integer-as-raw($NO_MORE_DIRENTRIES)) & (unix-last-error() ~= 0))
unix-file-error("continue listing of", "%s", directory)
end;
+*/
cleanup
if (primitive-machine-word-not-equal?
(primitive-unwrap-machine-word(directory-fd),
Modified: trunk/fundev/sources/system/file-system/unix-interface.dylan
==============================================================================
--- trunk/fundev/sources/system/file-system/unix-interface.dylan (original)
+++ trunk/fundev/sources/system/file-system/unix-interface.dylan Tue May 16 14:07:24 2006
@@ -88,7 +88,7 @@
define function unix-lseek
(fd :: <integer>, position :: <integer>, mode :: <integer>) => (position :: <integer>)
with-interrupt-repeat
- unix-lseek(fd, posittion, mode)
+ unwrapped-unix-lseek(fd, position, mode)
end
end function unix-lseek;
@@ -104,7 +104,7 @@
end function get-unix-error;
define function unix-errno-value () => (errno :: <integer>)
- raw-as-integer(errno())
+ raw-as-integer(unix-errno())
end function unix-errno-value;
Modified: trunk/fundev/sources/system/library.dylan
==============================================================================
--- trunk/fundev/sources/system/library.dylan (original)
+++ trunk/fundev/sources/system/library.dylan Tue May 16 14:07:24 2006
@@ -351,7 +351,7 @@
use threads;
use simple-format;
use streams-internals;
- use unix-portability;
+ use unix-portability, rename: { unix-lseek => unwrapped-unix-lseek };
use operating-system, export: all;
use date, export: all;
use locators-internals, export: all;
More information about the chatter
mailing list