From b90aeee25c491f88c6a3361e55d98378ea08e41a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 20 Oct 2008 11:32:55 -0500 Subject: [PATCH] use readdir on openbsd until we upgrade so the build machine is ok --- basis/io/unix/files/bsd/bsd.factor | 5 ++++- basis/io/unix/files/files.factor | 6 +++++- basis/io/unix/files/openbsd/authors.txt | 1 + basis/io/unix/files/openbsd/openbsd.factor | 7 +++++++ basis/io/unix/files/openbsd/tags.txt | 1 + basis/unix/unix.factor | 1 + 6 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 basis/io/unix/files/openbsd/authors.txt create mode 100644 basis/io/unix/files/openbsd/openbsd.factor create mode 100644 basis/io/unix/files/openbsd/tags.txt diff --git a/basis/io/unix/files/bsd/bsd.factor b/basis/io/unix/files/bsd/bsd.factor index 18e713af2f..3c94baa39a 100644 --- a/basis/io/unix/files/bsd/bsd.factor +++ b/basis/io/unix/files/bsd/bsd.factor @@ -13,5 +13,8 @@ M: bsd stat>file-info ( stat -- file-info ) { [ stat-st_flags >>flags ] [ stat-st_gen >>gen ] - [ stat-st_birthtimespec timespec>unix-time >>birth-time ] + [ + stat-st_birthtimespec timespec>unix-time + >>birth-time + ] } cleave ; diff --git a/basis/io/unix/files/files.factor b/basis/io/unix/files/files.factor index 67da640b71..2b85420ee9 100644 --- a/basis/io/unix/files/files.factor +++ b/basis/io/unix/files/files.factor @@ -142,7 +142,9 @@ os { [ opendir dup [ (io-error) ] unless ] dip dupd curry swap '[ _ closedir io-error ] [ ] cleanup ; inline -: find-next-file ( DIR* -- byte-array ) +HOOK: find-next-file os ( DIR* -- byte-array ) + +M: unix find-next-file ( DIR* -- byte-array ) "dirent" f [ readdir_r 0 = [ (io-error) ] unless ] 2keep @@ -159,6 +161,8 @@ M: unix (directory-entries) ( path -- seq ) [ drop ] produce ] with-unix-directory ; +os openbsd = [ "io.unix.files.openbsd" require ] when +