From dcfd69fbe3b7da3313b36c71a4e19599038aa622 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 18 Jun 2013 03:18:47 +0000 Subject: [PATCH] fix request-logging build on windows --- src/session_impl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index efbfa4ea4..f96f62532 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -693,7 +693,12 @@ namespace aux { #ifdef TORRENT_REQUEST_LOGGING char log_filename[200]; - snprintf(log_filename, sizeof(log_filename), "requests-%d.log", getpid()); +#ifdef TORRENT_WINDOWS + const int pid = GetCurrentProcessId(); +#else + const int pid = getpid(); +#endif + snprintf(log_filename, sizeof(log_filename), "requests-%d.log", pid); m_request_log = fopen(log_filename, "w+"); if (m_request_log == 0) {