diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2015-01-02 15:32:47 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2015-01-02 15:34:09 +0000 |
commit | c45be2ecf42b45fe127522ef7fb149d4bcfdf916 (patch) | |
tree | bebb7d04aa53c722a43074d312a6205d71a50fff /desktop/hotlist.c | |
parent | 6ffab5885de60e984d7e82615a0d47588b2e428d (diff) | |
download | netsurf-c45be2ecf42b45fe127522ef7fb149d4bcfdf916.tar.gz netsurf-c45be2ecf42b45fe127522ef7fb149d4bcfdf916.tar.bz2 |
Handle failure to remove or rename.
Diffstat (limited to 'desktop/hotlist.c')
-rw-r--r-- | desktop/hotlist.c | 10 |
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); |