About close() in commit_lock_file()
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Aug 5, 2013, 14:23 UTC
- Message-ID
- <CACsJy8By1cpPZ5QyVd6VhKSkd-y_E6pTYdDimK9P0wXia-uMqg@mail.gmail.com>
close() is added in commit_lock_file(), before rename(), by 4723ee9 (Close files opened by lock_file() before unlinking. - 2007-11-13), which is needed by Windows. But doesn't that create a gap between close() and rename() on other platforms where another process can replace .lock file with something else before rename() is executed? Should we enclose close() in #ifdef __MINGW32__ (and maybe __CYGWIN__)? -- Duy