summaryrefslogtreecommitdiff
path: root/apps/bookmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 20841b4940..8256f76ef8 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -290,10 +290,8 @@ static bool add_bookmark(const char* bookmark_file_name, const char* bookmark,
290 bool equal; 290 bool equal;
291 291
292 /* Opening up a temp bookmark file */ 292 /* Opening up a temp bookmark file */
293 snprintf(global_temp_buffer, sizeof(global_temp_buffer), 293 temp_bookmark_file = open_pathfmt(global_temp_buffer, sizeof(global_temp_buffer),
294 "%s.tmp", bookmark_file_name); 294 O_WRONLY | O_CREAT | O_TRUNC, "%s.tmp", bookmark_file_name);
295 temp_bookmark_file = open(global_temp_buffer,
296 O_WRONLY | O_CREAT | O_TRUNC, 0666);
297 if (temp_bookmark_file < 0) 295 if (temp_bookmark_file < 0)
298 return false; /* can't open the temp file */ 296 return false; /* can't open the temp file */
299 297
@@ -893,10 +891,8 @@ static bool delete_bookmark(const char* bookmark_file_name, int bookmark_id)
893 int bookmark_count = 0; 891 int bookmark_count = 0;
894 892
895 /* Opening up a temp bookmark file */ 893 /* Opening up a temp bookmark file */
896 snprintf(global_temp_buffer, sizeof(global_temp_buffer), 894 temp_bookmark_file = open_pathfmt(global_temp_buffer, sizeof(global_temp_buffer),
897 "%s.tmp", bookmark_file_name); 895 O_WRONLY | O_CREAT | O_TRUNC, "%s.tmp", bookmark_file_name);
898 temp_bookmark_file = open(global_temp_buffer,
899 O_WRONLY | O_CREAT | O_TRUNC, 0666);
900 896
901 if (temp_bookmark_file < 0) 897 if (temp_bookmark_file < 0)
902 return false; /* can't open the temp file */ 898 return false; /* can't open the temp file */