Skip to contentSkip to conversation

fsmonitor: fix building with NO_PTHREADS

RFC PATCH In review Carlo Marcelo Arenas Belón 2 participants 3 messages Aug 17, 2021 – Aug 18, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 fsmonitor: fix building with NO_PTHREADS

something similar will be needed for the NO_UNIX_SOCKETS, since the system setting for support of FSMONITOR_DAEMON_BACKEND is not enough to cover for the code dependencies.

alternatively FSMONITOR_DAEMON_BACKEND could be used to imply support was requested AND code dependencies are covered, but this setup at least allows for building and uses the "mock" implementation.

since the enum is needed for the fallback code, had to be moved outside of the #ifdef

---
 Makefile     |  2 ++
 simple-ipc.h | 14 +++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)
Makefile +2 -0
index 987677e882..752ec7ccd9 100644
@@ -1969,10 +1969,12 @@ ifdef NEED_ACCESS_ROOT_HANDLER
 	COMPAT_OBJS += compat/access.o
 endif
 
+ifndef NO_PTHREADS
 ifdef FSMONITOR_DAEMON_BACKEND
 	COMPAT_CFLAGS += -DHAVE_FSMONITOR_DAEMON_BACKEND
 	COMPAT_OBJS += compat/fsmonitor/fsmonitor-fs-listen-$(FSMONITOR_DAEMON_BACKEND).o
 endif
+endif
 
 ifeq ($(TCLTK_PATH),)
 NO_TCLTK = NoThanks
simple-ipc.h +7 -7
index 9c7330fcda..b396293bdf 100644
@@ -5,13 +5,6 @@
  * See Documentation/technical/api-simple-ipc.txt
  */
 
-#ifdef SUPPORTS_SIMPLE_IPC
-#include "pkt-line.h"
-
-/*
- * Simple IPC Client Side API.
- */
-
 enum ipc_active_state {
 	/*
 	 * The pipe/socket exists and the daemon is waiting for connections.
@@ -43,6 +36,13 @@ enum ipc_active_state {
 	IPC_STATE__OTHER_ERROR,
 };
 
+#ifdef SUPPORTS_SIMPLE_IPC
+#include "pkt-line.h"
+
+/*
+ * Simple IPC Client Side API.
+ */
+
 struct ipc_client_connect_options {
 	/*
 	 * Spin under timeout if the server is running but can't
Signature · 1 line
2.33.0.476.gf000ecbed9
#1 lore raw
Quoted 8 lines · Carlo Marcelo Arenas Belón

something similar will be needed for the NO_UNIX_SOCKETS, since the system setting for support of FSMONITOR_DAEMON_BACKEND is not enough to cover for the code dependencies.

alternatively FSMONITOR_DAEMON_BACKEND could be used to imply support was requested AND code dependencies are covered, but this setup at least allows for building and uses the "mock" implementation.

Quoted 5 lines

since the enum is needed for the fallback code, had to be moved outside of the #ifdef

...

Thanks, I'll incorporate this into my next version. BTW, what platform did you detect this on?

Jeff

#2 lore raw
Quoted 2 lines · Jeff Hostetler

BTW, what platform did you detect this on?

macOS, when building with:

  $ make NO_PTHREADS=1

obviously not using the defaults.

Carlo