diff --git a/lib/context.c b/lib/context.c
index cd2cbc00658a9767c5e589d78009a6bb8911a518..faa339bbb29747f9140fdb00c1a28a19dd07a847 100644
--- a/lib/context.c
+++ b/lib/context.c
@@ -75,7 +75,7 @@ LWS_VISIBLE struct lws_context *
 lws_create_context(struct lws_context_creation_info *info)
 {
 	struct lws_context *context = NULL;
-#if LWS_POSIX
+#ifndef LWS_NO_DAEMONIZE
 	int pid_daemon = get_daemonize_pid();
 #endif
 	char *p;
@@ -111,13 +111,12 @@ lws_create_context(struct lws_context_creation_info *info)
 		lwsl_err("No memory for websocket context\n");
 		return NULL;
 	}
-#if LWS_POSIX
+#ifndef LWS_NO_DAEMONIZE
 	if (pid_daemon) {
 		context->started_with_parent = pid_daemon;
 		lwsl_notice(" Started with daemon pid %d\n", pid_daemon);
 	}
 #endif
-
 	context->listen_service_extraseen = 0;
 	context->protocols = info->protocols;
 	context->token_limits = info->token_limits;