libressl: Add missing timespecsub().
authorzrj <rimvydas.jasinskas@gmail.com>
Fri, 12 Apr 2019 17:34:28 +0000 (20:34 +0300)
committerzrj <zrj@dragonflybsd.org>
Wed, 24 Apr 2019 17:11:03 +0000 (20:11 +0300)
The <sys/time.h> needs update for 3 arg macros.

crypto/libressl/apps/openssl/apps_posix.c

index cdcf821..82db35e 100644 (file)
 
 #include "apps.h"
 
+#define timespecsub(tsp, usp, vsp)                                     \
+       do {                                                            \
+               (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec;          \
+               (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec;       \
+               if ((vsp)->tv_nsec < 0) {                               \
+                       (vsp)->tv_sec--;                                \
+                       (vsp)->tv_nsec += 1000000000L;                  \
+               }                                                       \
+       } while (0)
+
 double
 app_timer_real(int get)
 {