From d4172cca472cf6f93bdcccbeba8c0d1444982ce1 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Tue, 13 May 2008 23:00:41 -0500 Subject: [PATCH] Convert usages of 'close' to 'close-file' --- extra/io/unix/backend/backend.factor | 3 +-- extra/io/unix/files/files.factor | 4 ++-- extra/io/unix/launcher/launcher.factor | 2 +- extra/io/unix/mmap/mmap.factor | 4 ++-- extra/io/unix/sockets/sockets.factor | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/extra/io/unix/backend/backend.factor b/extra/io/unix/backend/backend.factor index 652d4e77b3..fe45d433e6 100644 --- a/extra/io/unix/backend/backend.factor +++ b/extra/io/unix/backend/backend.factor @@ -85,8 +85,7 @@ M: integer init-handle ( fd -- ) [ F_SETFL O_NONBLOCK fcntl drop ] [ F_SETFD FD_CLOEXEC fcntl drop ] bi ; -M: integer close-handle ( fd -- ) - close ; +M: integer close-handle ( fd -- ) close-file ; TUPLE: unix-io-error error port ; diff --git a/extra/io/unix/files/files.factor b/extra/io/unix/files/files.factor index c4f10ebb7b..80073e6aed 100755 --- a/extra/io/unix/files/files.factor +++ b/extra/io/unix/files/files.factor @@ -32,7 +32,7 @@ M: unix (file-writer) ( path -- stream ) : open-append ( path -- fd ) append-flags file-mode open-file - [ dup 0 SEEK_END lseek io-error ] [ ] [ close ] cleanup ; + [ dup 0 SEEK_END lseek io-error ] [ ] [ close-file ] cleanup ; M: unix (file-appender) ( path -- stream ) open-append ; @@ -43,7 +43,7 @@ M: unix (file-appender) ( path -- stream ) M: unix touch-file ( path -- ) normalize-path dup exists? [ touch ] [ - touch-mode file-mode open-file close + touch-mode file-mode open-file close-file ] if ; M: unix move-file ( from to -- ) diff --git a/extra/io/unix/launcher/launcher.factor b/extra/io/unix/launcher/launcher.factor index 1a0bab73c3..5a11e56cd9 100755 --- a/extra/io/unix/launcher/launcher.factor +++ b/extra/io/unix/launcher/launcher.factor @@ -31,7 +31,7 @@ USE: unix ] when* ; : redirect-fd ( oldfd fd -- ) - 2dup = [ 2drop ] [ dupd dup2 io-error close ] if ; + 2dup = [ 2drop ] [ dupd dup2 io-error close-file ] if ; : reset-fd ( fd -- ) #! We drop the error code because on *BSD, fcntl of diff --git a/extra/io/unix/mmap/mmap.factor b/extra/io/unix/mmap/mmap.factor index 4b015a071e..216f98ee58 100755 --- a/extra/io/unix/mmap/mmap.factor +++ b/extra/io/unix/mmap/mmap.factor @@ -8,7 +8,7 @@ IN: io.unix.mmap : mmap-open ( length prot flags path -- alien fd ) >r f -roll r> open-r/w [ 0 mmap ] keep - over MAP_FAILED = [ close (io-error) ] when ; + over MAP_FAILED = [ close-file (io-error) ] when ; M: unix (mapped-file) ( path length -- obj ) swap >r @@ -18,5 +18,5 @@ M: unix (mapped-file) ( path length -- obj ) M: unix close-mapped-file ( mmap -- ) [ mapped-file-address ] keep [ mapped-file-length munmap ] keep - mapped-file-handle close + mapped-file-handle close-file io-error ; diff --git a/extra/io/unix/sockets/sockets.factor b/extra/io/unix/sockets/sockets.factor index fee4821f50..51b198bdc0 100755 --- a/extra/io/unix/sockets/sockets.factor +++ b/extra/io/unix/sockets/sockets.factor @@ -79,7 +79,7 @@ M: accept-task do-io-task >r dup protocol-family r> socket-fd dup init-server-socket dup rot make-sockaddr/size bind - zero? [ dup close (io-error) ] unless ; + zero? [ dup close-file (io-error) ] unless ; M: unix (server) ( addrspec -- handle ) [