summaryrefslogtreecommitdiffstats
path: root/apps/bookmark.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2008-04-16 19:51:43 +0000
committerNils Wallménius <nils@rockbox.org>2008-04-16 19:51:43 +0000
commita01996436d09eca8ae114e67005d2cac73cae7b3 (patch)
tree013d6787d3c03265049536677e817572c4285119 /apps/bookmark.c
parentd65930f9720b0d51313b0e76251e56d2ffa144dd (diff)
downloadrockbox-a01996436d09eca8ae114e67005d2cac73cae7b3.tar.gz
rockbox-a01996436d09eca8ae114e67005d2cac73cae7b3.tar.bz2
rockbox-a01996436d09eca8ae114e67005d2cac73cae7b3.zip
Use file_exists and dir_exists functions where appropriate, fix one wrong file descriptor check and one possible dir descriptor leak
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17147 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 363660306c..30102bb954 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -380,8 +380,6 @@ static bool check_bookmark(const char* bookmark)
/* ------------------------------------------------------------------------*/
bool bookmark_autoload(const char* file)
{
- int fd;
-
if(global_settings.autoloadbookmark == BOOKMARK_NO)
return false;
@@ -390,10 +388,10 @@ bool bookmark_autoload(const char* file)
{
return false;
}
- fd = open(global_bookmark_file_name, O_RDONLY);
- if(fd<0)
+
+ if(!file_exists(global_bookmark_file_name))
return false;
- close(fd);
+
if(global_settings.autoloadbookmark == BOOKMARK_YES)
{
return bookmark_load(global_bookmark_file_name, true);
@@ -1040,12 +1038,7 @@ bool bookmark_exist(void)
sizeof(global_temp_buffer));
if (generate_bookmark_file_name(name))
{
- int fd=open(global_bookmark_file_name, O_RDONLY);
- if (fd >=0)
- {
- close(fd);
- exist=true;
- }
+ exist = file_exists(global_bookmark_file_name);
}
}