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 e139f19b4819ae0d2b212c1262bf95262b670627
parent 063ad5b9f7e3da19f15cb314c49701a6d54a6a33
Author: Commit-Bot <unknown>
Date:   Fri,  3 Sep 2010 06:31:46 +0000

Automatic commit from picoLisp.tgz, From: Fri, 03 Sep 2010 06:31:46 GMT
Diffstat:
Mlib/el/picolisp.el | 2+-
Msrc/io.c | 14++++++++------
Msrc64/io.l | 12++++++------
3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/lib/el/picolisp.el b/lib/el/picolisp.el @@ -320,7 +320,7 @@ See `run-hooks'." "space" "beep" "tab" "flush" "rewind" "rd" "pr" "wr" "rpc" "wait" "sync" "echo" "info" "file" "dir" "lines" "open" "close" "port" "listen" "accept" "host" "connect" - "nagle" "udp" "script" "once" "rc" "pretty" "pp" "show" + "udp" "script" "once" "rc" "pretty" "pp" "show" "view" "here" "prEval" "mail" ;; Object Orientation "*Class" "class" "dm" "rel" "var" "var:" "new" "type" diff --git a/src/io.c b/src/io.c @@ -1,4 +1,4 @@ -/* 30aug10abu +/* 02sep10abu * (c) Software Lab. Alexander Burger */ @@ -168,17 +168,19 @@ int rdBytes(int fd, byte *p, int cnt, bool nb) { bool wrBytes(int fd, byte *p, int cnt) { int n; - do { - if ((n = write(fd, p, cnt)) >= 0) - p += n, cnt -= n; + for (;;) { + if ((n = write(fd, p, cnt)) >= 0) { + if ((cnt -= n) == 0) + return YES; + p += n; + } else if (errno == EBADF || errno == EPIPE || errno == ECONNRESET) return NO; else if (errno != EINTR) writeErr("bytes"); if (*Signal) sighandler(NULL); - } while (cnt); - return YES; + } } static void wrChild(int i, byte *p, int cnt) { diff --git a/src64/io.l b/src64/io.l @@ -1,4 +1,4 @@ -# 01sep10abu +# 02sep10abu # (c) Software Lab. Alexander Burger # Close file descriptor @@ -320,11 +320,11 @@ else call errno_A cmp A EBADF # Bad file number? - jz retnz # Return 'nz' + jeq retnz # Return 'nz' cmp A EPIPE # Broken pipe? - jz retnz # Return 'nz' + jeq retnz # Return 'nz' cmp A ECONNRESET # Connection reset by peer? - jz retnz # Return 'nz' + jeq retnz # Return 'nz' cmp A EINTR # Interrupted? jne wrBytesErr # No end @@ -508,7 +508,7 @@ if z # No ld E A cmp B BEG # Begin a list? - jnz retnc # No: Return DOT or END (also in B) + jne retnc # No: Return DOT or END (also in B) call binReadZ_FE # Else read list jc ret push X @@ -3080,7 +3080,7 @@ loop set (Sync) 0 # Clear sync flag do - ld C -1 # No fd + ld C -1 # No file descriptor ld E C # Wait infinite call waitFdCEX_A # Wait for events nul (Sync) # Synchronized?