Skip to content

Commit 0567dc7

Browse files
DeusDataclaude
andcommitted
fix(daemon): guard the POSIX listen-failure recorder so Windows does not see it unused
The rich errno+path recorder ipc_listen_failed (and ipc_listen_failure_reset) are defined before the POSIX '#ifndef _WIN32' listener block but only called inside it, so the Windows build compiled them dead and failed under -Werror,-Wunused-function (pr-smoke windows-latest). Wrap both in the same '#ifndef _WIN32'; the failure struct and its cross-platform accessor cbm_daemon_ipc_listen_failure_detail stay compiled on every platform. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 00060ce commit 0567dc7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/daemon/ipc.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ const char *cbm_daemon_ipc_validation_detail(void) {
5656

5757
static cbm_daemon_ipc_listen_failure_t ipc_listen_failure;
5858

59+
/* The failure recorder and its reset are only reached from the POSIX socket
60+
* listener (all callers live in the `#ifndef _WIN32` block below); the Windows
61+
* named-pipe listener does its own reporting. Guarding them keeps the always-
62+
* compiled struct + accessor cross-platform while avoiding -Werror,
63+
* -Wunused-function on the Windows build (#1828 CI). */
64+
#ifndef _WIN32
5965
static void ipc_listen_failure_reset(void) {
6066
memset(&ipc_listen_failure, 0, sizeof(ipc_listen_failure));
6167
}
@@ -92,6 +98,7 @@ static void ipc_listen_failed(const char *runtime_dir, const char *stage, int er
9298
cbm_log_error("daemon.ipc.listen_failed", "stage", stage);
9399
}
94100
}
101+
#endif /* !_WIN32 */
95102

96103
bool cbm_daemon_ipc_listen_failure_detail(cbm_daemon_ipc_listen_failure_t *out) {
97104
if (!out) {

0 commit comments

Comments
 (0)