From: Darren Tucker Date: Thu, 18 Nov 2021 12:44:07 +0000 (+1100) Subject: Correct calculation of tv_nsec in poll(). X-Git-Tag: V_8_9_P1~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d902d728dfd81622454260e23bc09d5e5a9a795e;p=thirdparty%2Fopenssh-portable.git Correct calculation of tv_nsec in poll(). --- diff --git a/openbsd-compat/bsd-poll.c b/openbsd-compat/bsd-poll.c index f1b2f119c..b661c030e 100644 --- a/openbsd-compat/bsd-poll.c +++ b/openbsd-compat/bsd-poll.c @@ -120,7 +120,7 @@ poll(struct pollfd *fds, nfds_t nfds, int timeout) /* poll timeout is msec, ppoll is timespec (sec + nsec) */ if (timeout >= 0) { ts.tv_sec = timeout / 1000; - ts.tv_nsec = (timeout % 1000000) * 1000000; + ts.tv_nsec = (timeout % 1000) * 1000000; tsp = &ts; }