From cf954f949427382d2f74862255730a370d800405 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 3 Feb 2015 10:15:37 +0000 Subject: 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. --- desktop/hotlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/desktop/hotlist.c b/desktop/hotlist.c index 7e14143ca..8f76c62a3 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -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; -- cgit v1.2.3