summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-01-23 14:11:43 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2015-01-23 14:11:43 +0000
commit5d51547ea7505d97efeac12ae8f136b97cc51405 (patch)
tree301056cca7182a85c55e7a7e5e27bf02fa739d99
parent19f12b01a47c559ac7b05303540a83217d6ebff2 (diff)
downloadnetsurf-5d51547ea7505d97efeac12ae8f136b97cc51405.tar.gz
netsurf-5d51547ea7505d97efeac12ae8f136b97cc51405.tar.bz2
Remove redundant remove() call.
-rw-r--r--desktop/hotlist.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index dce5430b4..7e14143ca 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -936,18 +936,10 @@ static nserror hotlist_save(const char *path)
goto cleanup;
}
- /* Remove old hotlist file, and replace */
- if (remove(path) != 0) {
- if (errno == ENOENT) {
- /* There was no original file to remove. */
- } else {
- res = NSERROR_SAVE_FAILED;
- LOG(("Error: %s.", strerror(errno)));
- goto cleanup;
- }
- }
+ /* Replace any old hotlist file with the one we just saved */
if (rename(temp_path, path) != 0) {
res = NSERROR_SAVE_FAILED;
+ LOG(("Error renaming hotlist: %s.", strerror(errno)));
goto cleanup;
}
@@ -1287,7 +1279,7 @@ nserror hotlist_fini(const char *path)
/* Save the hotlist */
err = hotlist_save(path);
if (err != NSERROR_OK) {
- warn_user("Couldn't save the hotlist.", 0);
+ LOG(("Problem saving the hotlist.", 0));
}
/* Destroy the hotlist treeview */