forked from enlightenment/efl
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:
parent
cd2b3c228d
commit
6b493430df
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue