efreetd - cache generators - dont unlink then rename - fix

if you unlink then rename, there is a gap between the unlink and
rename - no file is there. the point of the rename is to be atomic.
either old file OR new file. nothing in between. this fixes that race.
This commit is contained in:
Carsten Haitzler 2015-04-12 22:18:48 +09:00
parent cd2b3c228d
commit 6b493430df
1 changed files with 0 additions and 8 deletions

View File

@ -493,14 +493,6 @@ main(int argc, char **argv)
/* unlink old cache files */
if (changed)
{
if (unlink(efreet_desktop_cache_file()) < 0)
{
if (errno != ENOENT) goto error;
}
if (unlink(efreet_desktop_util_cache_file()) < 0)
{
if (errno != ENOENT) goto error;
}
/* rename tmp files to real files */
if (rename(util_file, efreet_desktop_util_cache_file()) < 0) goto error;
efreet_setowner(efreet_desktop_util_cache_file());