btime: also preserve -1 in unixtimeint, as in unixtimefloat
[lcore.git] / btime.pas
index a3428e8546c6e39d0a52e1b2d92ee0e1d352df8e..8826a4da4afd1b315060d246d172d58a91dcc13e 100644 (file)
--- a/btime.pas
+++ b/btime.pas
@@ -255,7 +255,7 @@ begin
   gettimeofday(tv);\r
   sec := tv.tv_sec;\r
   {$ifndef cpu64}\r
-  if (sec < 0) then inc(sec,$100000000); //tv_sec is 32 bits\r
+  if (sec < -1) then inc(sec,$100000000); //tv_sec is 32 bits. allow -1 for invalid result\r
   {$endif}\r
   result := sec;\r
 end;\r