diff mbox series

include/util.h: fix build on musl

Message ID 20230915091457.3206927-1-dominique.martinet@atmark-techno.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series include/util.h: fix build on musl | expand

Commit Message

Dominique Martinet Sept. 15, 2023, 9:14 a.m. UTC
Building on musl 1.2.4 fails with the following error/warnings:

include/util.h:211:23: error: unknown type name 'mode_t'
  211 | int mkpath(char *dir, mode_t mode);
include/util.h:269:36: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
  269 | char *swupdate_time_iso8601(struct timeval *tv);

These were caused by a recent reorganization of the headers and glibc
appears more tolerant here.

Fixes: 8228b1390632 ("Reorganize includes to have smaller files")
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
 include/util.h | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/util.h b/include/util.h
index 3c2a42fc3485..dbf14861b8f2 100644
--- a/include/util.h
+++ b/include/util.h
@@ -8,11 +8,13 @@ 
 #ifndef _UTIL_H
 #define _UTIL_H
 
+#include <fcntl.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdbool.h>
+#include <sys/time.h>
 #if defined(__linux__)
 #include <linux/types.h>
 #endif