The AmigaOS rename() isn't POSIX compiant, so call remove() first.

There will be a race condition on AmigaOS if a hostlist file gets created
between the remove() and rename() calls.
This commit is contained in:
Michael Drake 2015-02-03 10:15:37 +00:00
parent 32cd4abfd5
commit cf954f9494

View File

@ -936,6 +936,9 @@ static nserror hotlist_save(const char *path)
goto cleanup;
}
/* Remove old hotlist to handle non-POSIX rename() implementations. */
(void)remove(path);
/* Replace any old hotlist file with the one we just saved */
if (rename(temp_path, path) != 0) {
res = NSERROR_SAVE_FAILED;