From 12b7c3af93b63a8f23ee396693c3ff6b83a102a7 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 20 Sep 2023 11:16:35 -0600 Subject: [PATCH] add Windows version of getpid --- apps/wolfsshd/configuration.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/wolfsshd/configuration.c b/apps/wolfsshd/configuration.c index 33f2b6ef..d1ffde8b 100644 --- a/apps/wolfsshd/configuration.c +++ b/apps/wolfsshd/configuration.c @@ -1451,7 +1451,11 @@ void wolfSSHD_ConfigSavePID(const WOLFSSHD_CONFIG* conf) WMEMSET(buf, 0, sizeof(buf)); if (WFOPEN(NULL, &f, conf->pidFile, "wb") == 0) { +#ifndef WIN32 WSNPRINTF(buf, sizeof(buf), "%d", getpid()); +#else + WSNPRINTF(buf, sizeof(buf), "%d", _getpid()); +#endif WFWRITE(NULL, buf, 1, WSTRLEN(buf), f); WFCLOSE(NULL, f); }