summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-01-02 15:32:47 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2015-01-02 15:34:09 +0000
commitc45be2ecf42b45fe127522ef7fb149d4bcfdf916 (patch)
treebebb7d04aa53c722a43074d312a6205d71a50fff
parent6ffab5885de60e984d7e82615a0d47588b2e428d (diff)
downloadnetsurf-c45be2ecf42b45fe127522ef7fb149d4bcfdf916.tar.gz
netsurf-c45be2ecf42b45fe127522ef7fb149d4bcfdf916.tar.bz2
Handle failure to remove or rename.
-rw-r--r--desktop/hotlist.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 512eb3ae3..212d6309a 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -937,8 +937,14 @@ static nserror hotlist_save(const char *path)
}
/* Remove old hotlist file, and replace */
- remove(path);
- rename(temp_path, path);
+ if (remove(path) != 0) {
+ res = NSERROR_SAVE_FAILED;
+ goto cleanup;
+ }
+ if (rename(temp_path, path) != 0) {
+ res = NSERROR_SAVE_FAILED;
+ goto cleanup;
+ }
cleanup:
free(temp_path);