summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/language.c8
-rw-r--r--apps/language.h2
2 files changed, 7 insertions, 3 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;
}
/* -----------------------------------------------------------------
diff --git a/apps/language.h b/apps/language.h
index 92b80ec018..a4c85615c6 100644
--- a/apps/language.h
+++ b/apps/language.h
@@ -25,7 +25,7 @@
#define LANGUAGE_VERSION 0x01
/* load a given language file */
-void lang_load(char *filename);
+int lang_load(char *filename);
/* -----------------------------------------------------------------
* local variables: