git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC PATCH] fsmonitor: fix building with NO_PTHREADS

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Aug 17, 2021, 08:23 UTC
Message-ID
<20210817082310.2157-1-carenas@gmail.com>

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

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 Makefile     |  2 ++
 simple-ipc.h | 14 +++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 987677e882..752ec7ccd9 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/simple-ipc.h b/simple-ipc.h
index 9c7330fcda..b396293bdf 100644
--- a/simple-ipc.h
+++ b/simple-ipc.h
@@ -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
-- 
2.33.0.476.gf000ecbed9
Next: Jeff Hostetler
Message 1 of 3 in “fsmonitor: fix building with NO_PTHREADS”
  1. fsmonitor: fix building with NO_PTHREADSCarlo Marcelo Arenas Belón, Aug 17, 2021
  2. Jeff HostetlerAug 17, 2021
  3. Carlo ArenasAug 18, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.