Add missing includes for time() and ctime() These headers were implicitly used on OpenBSD, but building on Linux revealed that <time.h> wasn't included directly. diffreg.c uses ctime(), which additionally needs <sys/types.h>.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/lib/diffreg.c b/lib/diffreg.c
index fc01cc3..ba57c9a 100644
--- a/lib/diffreg.c
+++ b/lib/diffreg.c
@@ -64,6 +64,7 @@
* @(#)diffreg.c 8.1 (Berkeley) 6/6/93
*/
+#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/queue.h>
@@ -79,6 +80,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#include <limits.h>
#include <sha1.h>
diff --git a/lib/repository.c b/lib/repository.c
index 6ee2cf1..b32361c 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <sha1.h>
#include <string.h>
+#include <time.h>
#include <zlib.h>
#include <errno.h>
#include <libgen.h>
diff --git a/lib/worktree.c b/lib/worktree.c
index aa70f13..c6ccac6 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <time.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>