From a293b8a2c5ac362b9fa268ed32491dc340833fcc Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Tue, 13 May 2008 13:32:55 -0500 Subject: [PATCH 1/4] unix.stat: Rename stat* and lstat*. Convert them to use 'unix-system-call'. --- extra/unix/stat/stat.factor | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/extra/unix/stat/stat.factor b/extra/unix/stat/stat.factor index cb1c939878..5864d33741 100644 --- a/extra/unix/stat/stat.factor +++ b/extra/unix/stat/stat.factor @@ -60,14 +60,12 @@ FUNCTION: int mkdir ( char* path, mode_t mode ) ; >> ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -: check-status ( n -- ) io-error ; +: file-status ( pathname -- stat ) + "stat" dup >r + [ stat ] unix-system-call drop + r> ; -: stat* ( pathname -- stat ) - "stat" dup >r - stat check-status - r> ; - -: lstat* ( pathname -- stat ) - "stat" dup >r - lstat check-status - r> ; +: link-status ( pathname -- stat ) + "stat" dup >r + [ lstat ] unix-system-call + r> ; From cdf99ea8f0a0c1aa8194a3df52337315f7365621 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Tue, 13 May 2008 13:37:25 -0500 Subject: [PATCH 2/4] io.unix.files: Update for renames --- extra/io/unix/files/files.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/io/unix/files/files.factor b/extra/io/unix/files/files.factor index 3254640900..e1da20be46 100755 --- a/extra/io/unix/files/files.factor +++ b/extra/io/unix/files/files.factor @@ -97,10 +97,10 @@ M: unix copy-file ( from to -- ) \ file-info boa ; M: unix file-info ( path -- info ) - normalize-path stat* stat>file-info ; + normalize-path file-status stat>file-info ; M: unix link-info ( path -- info ) - normalize-path lstat* stat>file-info ; + normalize-path link-status stat>file-info ; M: unix make-link ( path1 path2 -- ) normalize-path symlink io-error ; From dc2898b3cccc5a77f66cbf938d5f634f32800a22 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Tue, 13 May 2008 14:14:27 -0500 Subject: [PATCH 3/4] unix.stat: Bugfix --- extra/unix/stat/stat.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/unix/stat/stat.factor b/extra/unix/stat/stat.factor index 5864d33741..2bc60105b4 100644 --- a/extra/unix/stat/stat.factor +++ b/extra/unix/stat/stat.factor @@ -1,6 +1,6 @@ USING: kernel system combinators alien.syntax alien.c-types - math io.unix.backend vocabs.loader ; + math io.unix.backend vocabs.loader unix ; IN: unix.stat @@ -67,5 +67,5 @@ FUNCTION: int mkdir ( char* path, mode_t mode ) ; : link-status ( pathname -- stat ) "stat" dup >r - [ lstat ] unix-system-call + [ lstat ] unix-system-call drop r> ; From e96cb08a777f09fd0761722caf9c2ae9db21395c Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 May 2008 14:41:24 -0500 Subject: [PATCH 4/4] Load fix --- extra/io/unix/linux/monitors/monitors.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/io/unix/linux/monitors/monitors.factor b/extra/io/unix/linux/monitors/monitors.factor index cd17dfbbce..31dbe42e64 100644 --- a/extra/io/unix/linux/monitors/monitors.factor +++ b/extra/io/unix/linux/monitors/monitors.factor @@ -23,7 +23,7 @@ TUPLE: linux-monitor < monitor wd inotify watches ; : wd>monitor ( wd -- monitor ) watches get at ; : ( -- port/f ) - inotify_init dup 0 < [ drop f ] [ ] if ; + inotify_init dup 0 < [ drop f ] [ ] if ; : inotify-fd inotify get handle>> ;