diff mbox series

progress: Fix FreeBSD build

Message ID D6540ABF-1660-46B0-9120-68B6D85239B3@siemens.com
State Accepted
Headers show
Series progress: Fix FreeBSD build | expand

Commit Message

Storm, Christian Jan. 15, 2025, 4:40 p.m. UTC
FreeBSD hasn't defined ENODATA nor ETIME in errno.h.
Hence, define them by their semantically closest error
code existing in errno.h:
* Define ENODATA as ENOATTR (as in include/compat.h)
* Define ETIME as ETIMEDOUT

Note that other BSDs like NetBSD have them defined, so
this is for FreeBSD exclusively.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 ipc/progress_ipc.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/ipc/progress_ipc.c b/ipc/progress_ipc.c
index c6a4af46..d3689271 100644
--- a/ipc/progress_ipc.c
+++ b/ipc/progress_ipc.c
@@ -16,6 +16,10 @@ 
 #include <unistd.h>
 #include <stdbool.h>
 #include <progress_ipc.h>
+#if defined(__FreeBSD__)
+#define ENODATA ENOATTR
+#define ETIME ETIMEDOUT
+#endif
 
 #ifdef CONFIG_SOCKET_PROGRESS_PATH
 char *SOCKET_PROGRESS_PATH = (char*)CONFIG_SOCKET_PROGRESS_PATH;