summaryrefslogtreecommitdiffstats
path: root/apps/language.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-09-24 13:53:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-09-24 13:53:41 +0000
commit2d8aef9ab7e747baa1a3e984ebb1855d9aabf6ff (patch)
treef0afbcdefac35457ab70cc23c5479c597fda9116 /apps/language.c
parent85305da20dec92d3f0d061f7fcfd0b40d76b9cd1 (diff)
downloadrockbox-2d8aef9ab7e747baa1a3e984ebb1855d9aabf6ff.tar.gz
rockbox-2d8aef9ab7e747baa1a3e984ebb1855d9aabf6ff.tar.bz2
rockbox-2d8aef9ab7e747baa1a3e984ebb1855d9aabf6ff.zip
lang_load() returns an int to signal success
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2396 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/language.c')
-rw-r--r--apps/language.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/language.c b/apps/language.c
index 716ac69020..df8c32a05e 100644
--- a/apps/language.c
+++ b/apps/language.c
@@ -25,12 +25,13 @@
static unsigned char language_buffer[MAX_LANGUAGE_SIZE];
-void lang_load(char *filename)
+int lang_load(char *filename)
{
int filesize;
int fd = open(filename, O_RDONLY);
+ int retcode=0;
if(fd == -1)
- return;
+ return 1;
filesize = read(fd, language_buffer, MAX_LANGUAGE_SIZE);
if(filesize != MAX_LANGUAGE_SIZE) {
if((language_buffer[0] == LANGUAGE_COOKIE) &&
@@ -53,12 +54,15 @@ void lang_load(char *filename)
}
else {
DEBUGF("Illegal language file\n");
+ retcode = 2;
}
}
else {
DEBUGF("Language %s too large: %d\n", filename, filesize);
+ retcode = 3;
}
close(fd);
+ return retcode;
}
/* -----------------------------------------------------------------