hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
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
45
From b879e6886498fdd147287bffdf5867378c7f3299 Mon Sep 17 00:00:00 2001
From: Baruch Siach <baruch@tkos.co.il>
Date: Thu, 24 Jun 2021 14:28:10 +0300
Subject: [PATCH] daemon: fix build with musl libc (again)
 
Commit 6b28c54dd95b3 added HAVE_SYS_TTYDEFAULTS_H to guard
sys/ttydefaults.h include. This breaks musl libc build because
HAVE_SYS_TTYDEFAULTS_H is not defined until config.h is included.
 
Move sys/ttydefaults.h include below config.h
 
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
Upstream status: https://github.com/raforg/daemon/pull/4
 
 daemon.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
 
diff --git a/daemon.c b/daemon.c
index 5c5ef2cb86df..f88a0d49bf84 100644
--- a/daemon.c
+++ b/daemon.c
@@ -1011,9 +1011,6 @@ I<elogind(8)>
 #ifdef _RESTORE_POSIX_SOURCE
 #define _POSIX_SOURCE
 #endif
-#ifdef HAVE_SYS_TTYDEFAULTS_H /* For CEOF in musl libc (Linux only) */
-#include <sys/ttydefaults.h>
-#endif
 #include <dirent.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
@@ -1037,6 +1034,10 @@ I<elogind(8)>
 #include <systemd/sd-login.h>
 #endif
 
+#ifdef HAVE_SYS_TTYDEFAULTS_H /* For CEOF in musl libc (Linux only) */
+#include <sys/ttydefaults.h>
+#endif
+
 /* Configuration file entries */
 
 typedef struct Config Config;
-- 
2.30.2