summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/clean-temp.c5
-rw-r--r--lib/tmpfile.c5
3 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 34bcd6db54..199b06cda8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-06-20 John Darrington <john@darrington.wattle.id.au> (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 <bruno@clisp.org>
fdopen: Allow implementations that don't reject invalid fd arguments.
diff --git a/lib/clean-temp.c b/lib/clean-temp.c
index b05550a430..ef926e52d6 100644
--- a/lib/clean-temp.c
+++ b/lib/clean-temp.c
@@ -583,6 +583,11 @@ supports_delete_on_close ()
{
OSVERSIONINFO v;
+ /* According to
+ <http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx>
+ 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 8249525202..2362a65364 100644
--- a/lib/tmpfile.c
+++ b/lib/tmpfile.c
@@ -54,6 +54,11 @@ supports_delete_on_close ()
{
OSVERSIONINFO v;
+ /* According to
+ <http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx>
+ this structure must be initialised as follows: */
+ v.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+
if (GetVersionEx (&v))
known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1);
else