chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] shouldn't file-close dispatch an interrupt on EINTR?


From: Jörg F . Wittenberger
Subject: [Chicken-hackers] shouldn't file-close dispatch an interrupt on EINTR?
Date: Tue, 22 Mar 2016 22:45:09 +0100
User-agent: Mozilla/5.0 (X11; Linux armv7l; rv:38.0) Gecko/20100101 Icedove/38.4.0

Hi all,

after literally years of wondering why I'm seeing lost file descriptors
I _guess_ I spotted the reason.  file-close raises an error when
close(2) returns a negative value.  IMHO it should look like this (not
yet tested):

(define file-close
  (lambda (fd)
    (##sys#check-exact fd 'file-close)
    (if (fx< (##core#inline "C_close" fd) 0)
        (select _errno
         ((_eintr) (##sys#dispatch-interrupt (lambda () (file-close fd))))
         (else (posix-error #:file-error 'file-close "cannot close file" fd)))
) ) )

Cheers

/Jörg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]