* fixed ppoll for infinite timeouts (patch by Edmund Grimley Evans)

git-svn-id: trunk@31042 -
This commit is contained in:
Jonas Maebe 2015-06-13 21:02:02 +00:00
parent ab43e07320
commit e54d0a41af

View File

@ -492,10 +492,15 @@ function fpPoll(fds: ppollfd; nfds: cuint; timeout: clong): cint;
{$if defined(generic_linux_syscalls)} {$if defined(generic_linux_syscalls)}
var ts : timespec; var ts : timespec;
begin begin
ts.tv_sec := timeout div 1000; if timeout<0 then
ts.tv_nsec := (timeout mod 1000) * 1000000; fpPoll:=do_syscall(syscall_nr_ppoll,tsysparam(fds),tsysparam(nfds),0,0)
fpPoll:=do_syscall(syscall_nr_ppoll,tsysparam(fds),tsysparam(nfds), else
tsysparam(@ts),0); begin
ts.tv_sec := timeout div 1000;
ts.tv_nsec := (timeout mod 1000) * 1000000;
fpPoll:=do_syscall(syscall_nr_ppoll,tsysparam(fds),tsysparam(nfds),
tsysparam(@ts),0);
end
end; end;
{$else} {$else}
begin begin