From 2221e4e4bd8253cda53de9bdbb953d5d7dfc31af Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 30 Mar 2016 19:21:05 +0000 Subject: [PATCH] * fix timespec=nil for -dgeneric_linux_syscalls (aarch64) case. git-svn-id: trunk@33392 - --- rtl/linux/bunxsysc.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rtl/linux/bunxsysc.inc b/rtl/linux/bunxsysc.inc index c8d7849672..c6d18be4e9 100644 --- a/rtl/linux/bunxsysc.inc +++ b/rtl/linux/bunxsysc.inc @@ -463,12 +463,18 @@ Function fpSelect(N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cin {$if defined(generic_linux_syscalls)} var ts : timespec; + pts : PTimeSpec; begin - ts.tv_sec := timeout^.tv_sec; - ts.tv_nsec := timeout^.tv_usec * 1000; + pts:=nil; + if assigned(timeout) then + begin + pts:=@ts; + ts.tv_sec := timeout^.tv_sec; + ts.tv_nsec := timeout^.tv_usec * 1000; + end; fpSelect:=do_syscall(syscall_nr_pselect6,n, tsysparam(readfds),tsysparam(writefds), - tsysparam(exceptfds),tsysparam(@ts),0); + tsysparam(exceptfds),tsysparam(pts),0); end; {$else}