Re: [chrony-dev] [Git][chrony/chrony][master] 7 commits: doc: improve description of logbanner

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


macOS does not declare SOCK_CLOEXEC and SOCK_NONBLOCK. I think the following patch will correct the warning.

diff --git a/socket.c b/socket.c
index d08b865..c5d15a7 100644
--- a/socket.c
+++ b/socket.c
@@ -44,6 +44,11 @@
 #include "ptp.h"
 #include "util.h"
  +#ifdef MACOSX
+#define SOCK_CLOEXEC FD_CLOEXEC
+#define SOCK_NONBLOCK O_NONBLOCK
+#endif
+
 #define INVALID_SOCK_FD (-4)
 #define CMSG_BUF_SIZE 256

> On 1 May 2025, at 06:47, Bryan Christianson <bryan@xxxxxxxxxxxxx> wrote:
> 
> Compiler warning on macOS Sequoia.
> 
> gcc -O2 -g -fstack-protector-strong --param=ssp-buffer-size=4 -Wmissing-prototypes -Wall -pthread  -c socket.c
> socket.c:216:1: warning: unused function 'get_default_inet_domain' [-Wunused-function]
>  216 | get_default_inet_domain(void)
>      | ^~~~~~~~~~~~~~~~~~~~~~~
> 1 warning generated.
> 
> 

Bryan Christianson
bryan@xxxxxxxxxxxxx




--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/