~ chicken-core (chicken-5) d79b2a674c7fae01b793492e5fb92be5cca52701
commit d79b2a674c7fae01b793492e5fb92be5cca52701
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Tue Jan 23 13:36:59 2024 +0100
Commit: Mario Domenech Goulart <mario@parenteses.org>
CommitDate: Mon Feb 12 20:32:46 2024 +0100
make file-select actually reflect what it is supposed to do
(thanks to "dzoe" for reporting this)
Signed-off-by: Mario Domenech Goulart <mario@parenteses.org>
diff --git a/manual/Module (chicken file posix) b/manual/Module (chicken file posix)
index 28fb6b76..95574f78 100644
--- a/manual/Module (chicken file posix)
+++ b/manual/Module (chicken file posix)
@@ -528,8 +528,8 @@ the buffer containing the data and the number of bytes read.
Waits until any of the file-descriptors given in the lists
{{READFDLIST}} and {{WRITEFDLIST}} is ready for input or
output, respectively. If the optional argument {{TIMEOUT}} is
-given and not false, then it should specify the number of milliseconds after
-which the wait is to be aborted. This procedure returns two values:
+given and not false, then it should specify the number of seconds after
+which the wait is to be aborted (the value may be a float). This procedure returns two values:
the lists of file-descriptors ready for input and output, respectively.
{{READFDLIST}} and {{WRITEFDLIST}} may also be file-descriptors
instead of lists. In this case the returned values are booleans
diff --git a/posixunix.scm b/posixunix.scm
index bad9b4c0..665c89e0 100644
--- a/posixunix.scm
+++ b/posixunix.scm
@@ -409,7 +409,6 @@ static int set_file_mtime(char *filename, C_word atime, C_word mtime)
(nfds (fx+ nfdsr nfdsw))
(fds-blob (##sys#make-blob
(fx* nfds (foreign-value "sizeof(struct pollfd)" int)))))
- (when tm (##sys#check-exact-integer tm))
(do ((i 0 (fx+ i 1))
(fdsrl fdsrl (cdr fdsrl)))
((null? fdsrl))
@@ -423,7 +422,7 @@ static int set_file_mtime(char *filename, C_word atime, C_word mtime)
"struct pollfd *fds = p;"
"fds[i].fd = fd; fds[i].events = POLLOUT;") i (car fdswl) fds-blob))
(let ((n ((foreign-lambda int "poll" scheme-pointer int int)
- fds-blob nfds (if tm (* (max 0 tm) 1000) -1))))
+ fds-blob nfds (if tm (inexact->exact (truncate (* (max 0 tm) 1000))) -1))))
(cond ((fx< n 0)
(posix-error #:file-error 'file-select "failed" fdsr fdsw) )
((fx= n 0) (values (if (pair? fdsr) '() #f) (if (pair? fdsw) '() #f)))
Trap