picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit a43d1562d96789e66e516e13bd844a87b53f85ee
parent aabad3050c61203684eb30bf60625cab6dde47e0
Author: Commit-Bot <unknown>
Date:   Sun, 30 May 2010 15:22:34 +0000

Automatic commit from picoLisp.tgz, From: Sun, 30 May 2010 12:22:34 GMT
Diffstat:
Mlib/tags | 28++++++++++++++--------------
Msrc/io.c | 12++++++++----
Msrc64/io.l | 33++++++++++++++++++++++-----------
3 files changed, 44 insertions(+), 29 deletions(-)

diff --git a/lib/tags b/lib/tags @@ -113,13 +113,13 @@ dir (2462 . "@src64/main.l") dm (563 . "@src64/flow.l") do (2152 . "@src64/flow.l") e (2623 . "@src64/flow.l") -echo (4166 . "@src64/io.l") +echo (4177 . "@src64/io.l") env (572 . "@src64/main.l") eof (3317 . "@src64/io.l") eol (3308 . "@src64/io.l") errno (1255 . "@src64/main.l") eval (208 . "@src64/flow.l") -ext (4853 . "@src64/io.l") +ext (4864 . "@src64/io.l") ext? (1034 . "@src64/sym.l") extern (900 . "@src64/sym.l") extra (1280 . "@src64/flow.l") @@ -134,7 +134,7 @@ find (1188 . "@src64/apply.l") fish (1479 . "@src64/apply.l") flg? (2417 . "@src64/subr.l") flip (1686 . "@src64/subr.l") -flush (4828 . "@src64/io.l") +flush (4839 . "@src64/io.l") fold (3341 . "@src64/sym.l") for (2241 . "@src64/flow.l") fork (2960 . "@src64/flow.l") @@ -249,13 +249,13 @@ poll (3120 . "@src64/io.l") pool (657 . "@src64/db.l") pop (1771 . "@src64/sym.l") port (5 . "@src64/net.l") -pr (4942 . "@src64/io.l") +pr (4953 . "@src64/io.l") pre? (1409 . "@src64/sym.l") -prin (4752 . "@src64/io.l") -prinl (4766 . "@src64/io.l") -print (4792 . "@src64/io.l") -println (4823 . "@src64/io.l") -printsp (4808 . "@src64/io.l") +prin (4763 . "@src64/io.l") +prinl (4777 . "@src64/io.l") +print (4803 . "@src64/io.l") +println (4834 . "@src64/io.l") +printsp (4819 . "@src64/io.l") prog (1773 . "@src64/flow.l") prog1 (1781 . "@src64/flow.l") prog2 (1798 . "@src64/flow.l") @@ -274,15 +274,15 @@ rand (2640 . "@src64/big.l") range (988 . "@src64/subr.l") rank (2966 . "@src64/subr.l") raw (453 . "@src64/main.l") -rd (4870 . "@src64/io.l") +rd (4881 . "@src64/io.l") read (2498 . "@src64/io.l") replace (1490 . "@src64/subr.l") rest (1957 . "@src64/main.l") reverse (1665 . "@src64/subr.l") -rewind (4836 . "@src64/io.l") +rewind (4847 . "@src64/io.l") rollback (1885 . "@src64/db.l") rot (848 . "@src64/subr.l") -rpc (4975 . "@src64/io.l") +rpc (4986 . "@src64/io.l") run (332 . "@src64/flow.l") sect (2513 . "@src64/subr.l") seed (2625 . "@src64/big.l") @@ -296,7 +296,7 @@ size (2750 . "@src64/subr.l") skip (3294 . "@src64/io.l") sort (3837 . "@src64/subr.l") sp? (711 . "@src64/sym.l") -space (4770 . "@src64/io.l") +space (4781 . "@src64/io.l") split (1579 . "@src64/subr.l") state (2022 . "@src64/flow.l") stem (1974 . "@src64/subr.l") @@ -338,7 +338,7 @@ when (1897 . "@src64/flow.l") while (2074 . "@src64/flow.l") wipe (3088 . "@src64/sym.l") with (1343 . "@src64/flow.l") -wr (4959 . "@src64/io.l") +wr (4970 . "@src64/io.l") xchg (1536 . "@src64/sym.l") xor (1714 . "@src64/flow.l") x| (2552 . "@src64/big.l") diff --git a/src/io.c b/src/io.c @@ -1,4 +1,4 @@ -/* 19may10abu +/* 30may10abu * (c) Software Lab. Alexander Burger */ @@ -2069,9 +2069,13 @@ any doClose(any ex) { any x; int fd; - x = cdr(ex), x = EVAL(car(x)); - if (close(fd = (int)xCnt(ex,x))) - return Nil; + x = cdr(ex), x = EVAL(car(x)), fd = (int)xCnt(ex,x); + while (close(fd)) { + if (errno != EINTR) + return Nil; + if (*Signal) + sighandler(ex); + } closeInFile(fd), closeOutFile(fd); return x; } diff --git a/src64/io.l b/src64/io.l @@ -1,4 +1,4 @@ -# 19may10abu +# 30may10abu # (c) Software Lab. Alexander Burger # Close file descriptor @@ -4118,7 +4118,7 @@ while s # No call errno_A cmp A EINTR # Interrupted? - if nz # No + if ne # No ld E Nil # Return NIL jmp 90 end @@ -4150,15 +4150,26 @@ eval ld C E # Keep in E call xCntCX_FC # Get fd - cc close(C) # Close it - nul4 # OK? - ldnz E Nil - if z # Yes - ld A C # Close InFile - call closeInFileA - ld A C # Close OutFile - call closeOutFileA - end + do + cc close(C) # Close it + nul4 # OK? + while nz # No + call errno_A + cmp A EINTR # Interrupted? + if ne # No + ld E Nil # Return NIL + pop X + ret + end + null (Signal) # Signal? + if nz # Yes + call sighandlerX + end + loop + ld A C # Close InFile + call closeInFileA + ld A C # Close OutFile + call closeOutFileA pop X ret