XP/2003 compatability fix
authorBruce Cran <bruce@cran.org.uk>
Wed, 3 Oct 2012 17:46:46 +0000 (19:46 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 3 Oct 2012 17:46:46 +0000 (19:46 +0200)
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 <axboe@kernel.dk>
os/windows/posix.c

index ce41ef8edfb75cb4df615ca5006fb39218434428..6ad47df8c7d08381314460558f05aba166f22216 100755 (executable)
@@ -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)