From: Bruce Cran Date: Wed, 3 Oct 2012 17:46:46 +0000 (+0200) Subject: XP/2003 compatability fix X-Git-Tag: fio-2.0.10~12 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=98dc2db5f11e6d597ca44aa6bf49f0dbd4397725;ds=inline XP/2003 compatability fix The attached patch fixes the bug that on XP fio fails with: "The procedure entry point vsprintf_s could not be located in the dynamic link library msvcrt.dll". Only Vista and newer have the 'secure' functions, so we need to use vsprintf to maintain compatibility with XP. Signed-off-by: Jens Axboe --- diff --git a/os/windows/posix.c b/os/windows/posix.c index ce41ef8e..6ad47df8 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -234,10 +234,10 @@ void syslog(int priority, const char *message, ... /* argument */) va_start(v, message); len = _vscprintf(message, v); output = malloc(len + sizeof(char)); - vsprintf_s(output, len + sizeof(char), message, v); + vsprintf(output, message, v); WriteFile(log_file, output, len, &bytes_written, NULL); va_end(v); - free(output); + free(output); } int kill(pid_t pid, int sig)