forked from len0rd/rockbox
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
This commit is contained in:
parent
d65930f972
commit
a01996436d
8 changed files with 18 additions and 52 deletions
|
|
@ -574,13 +574,10 @@ static void init(void)
|
|||
|
||||
#ifdef AUTOROCK
|
||||
{
|
||||
int fd;
|
||||
static const char filename[] = PLUGIN_APPS_DIR "/autostart.rock";
|
||||
|
||||
fd = open(filename, O_RDONLY);
|
||||
if(fd >= 0) /* no complaint if it doesn't exist */
|
||||
if(file_exists(filename)) /* no complaint if it doesn't exist */
|
||||
{
|
||||
close(fd);
|
||||
plugin_load((char*)filename, NULL); /* start if it does */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue