X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ftmpfile.c;h=2362a653649ce772bf889d7fc34423a7ca832c60;hb=a1bcd8bd3d60b8138a678d17763012ce825b5e7d;hp=f01de3a419fae42d75f92fa62add17fbde4836fd;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/lib/tmpfile.c b/lib/tmpfile.c index f01de3a41..2362a6536 100644 --- a/lib/tmpfile.c +++ b/lib/tmpfile.c @@ -1,5 +1,5 @@ /* Create a temporary file. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,6 +37,9 @@ #include "tempname.h" #include "tmpdir.h" +/* PATH_MAX is guaranteed to be defined, because this replacement is only + used on native Windows. */ + /* On Windows, opening a file with _O_TEMPORARY has the effect of passing the FILE_FLAG_DELETE_ON_CLOSE flag to CreateFile(), which has the effect of deleting the file when it is closed - even when the program crashes. @@ -51,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