From ebc6ce40ac3f349d69766e3b94db034a0245f3d7 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 20 Jun 2012 23:30:48 +0200 Subject: [PATCH] tmpfile, clean-temp: Fix invocation of GetVersionEx. * lib/tmpfile.c (supports_delete_on_close): Initialize parameter for GetVersionEx correctly. * lib/clean-temp.c (supports_delete_on_close): Likewise. --- ChangeLog | 7 +++++++ lib/clean-temp.c | 5 +++++ lib/tmpfile.c | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 34bcd6db5..199b06cda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-06-20 John Darrington (tiny change) + + tmpfile, clean-temp: Fix invocation of GetVersionEx. + * lib/tmpfile.c (supports_delete_on_close): Initialize parameter for + GetVersionEx correctly. + * lib/clean-temp.c (supports_delete_on_close): Likewise. + 2012-06-20 Bruno Haible fdopen: Allow implementations that don't reject invalid fd arguments. diff --git a/lib/clean-temp.c b/lib/clean-temp.c index b05550a43..ef926e52d 100644 --- a/lib/clean-temp.c +++ b/lib/clean-temp.c @@ -583,6 +583,11 @@ supports_delete_on_close () { OSVERSIONINFO v; + /* According to + + this structure must be initialised as follows: */ + v.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + if (GetVersionEx (&v)) known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1); else diff --git a/lib/tmpfile.c b/lib/tmpfile.c index 824952520..2362a6536 100644 --- a/lib/tmpfile.c +++ b/lib/tmpfile.c @@ -54,6 +54,11 @@ supports_delete_on_close () { OSVERSIONINFO v; + /* According to + + this structure must be initialised as follows: */ + v.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + if (GetVersionEx (&v)) known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1); else -- 2.11.0