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:
Nils Wallménius 2008-04-16 19:51:43 +00:00
parent d65930f972
commit a01996436d
8 changed files with 18 additions and 52 deletions

View file

@ -46,7 +46,7 @@ int lang_load(const char *filename)
int fd = open(filename, O_RDONLY);
int retcode=0;
unsigned char lang_header[3];
if(fd == -1)
if(fd < 0)
return 1;
fsize = filesize(fd) - 2;
if(fsize <= MAX_LANGUAGE_SIZE) {