diff options
author | ache <ache@FreeBSD.org> | 2002-08-03 11:55:19 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-08-03 11:55:19 +0000 |
commit | c7371a8702caef5aac390efe29993d9a8014e6b3 (patch) | |
tree | 8f5d09b29cc458ce5ea166c435b5aa77fe832f12 | |
parent | 5e42992e9605d84b1c82d785b2c3afc0fa5c9693 (diff) | |
download | FreeBSD-src-c7371a8702caef5aac390efe29993d9a8014e6b3.zip FreeBSD-src-c7371a8702caef5aac390efe29993d9a8014e6b3.tar.gz |
Return errno provided by fopen, not always ENOENT.
Return EFTYPE instead of EINVAL for wrong locale file format.
Whitespaces.
-rw-r--r-- | lib/libc/locale/setrunelocale.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c index 4d3cf0e..ec35b65 100644 --- a/lib/libc/locale/setrunelocale.c +++ b/lib/libc/locale/setrunelocale.c @@ -73,7 +73,7 @@ setrunelocale(encoding) */ if (!strcmp(encoding, "C") || !strcmp(encoding, "POSIX")) { _CurrentRuneLocale = &_DefaultRuneLocale; - return(0); + return (0); } if (_PathLocale == NULL) { @@ -100,27 +100,27 @@ setrunelocale(encoding) (void) strcat(name, "/LC_CTYPE"); if ((fp = fopen(name, "r")) == NULL) - return(ENOENT); + return (errno); if ((rl = _Read_RuneMagi(fp)) == 0) { fclose(fp); - return(EFTYPE); + return (EFTYPE); } fclose(fp); if (!rl->encoding[0]) - return(EINVAL); + return (EFTYPE); else if (!strcmp(rl->encoding, "NONE")) - return(_none_init(rl)); + return (_none_init(rl)); else if (!strcmp(rl->encoding, "UTF2")) - return(_UTF2_init(rl)); + return (_UTF2_init(rl)); else if (!strcmp(rl->encoding, "EUC")) - return(_EUC_init(rl)); + return (_EUC_init(rl)); else if (!strcmp(rl->encoding, "BIG5")) - return(_BIG5_init(rl)); + return (_BIG5_init(rl)); else if (!strcmp(rl->encoding, "MSKanji")) - return(_MSKanji_init(rl)); + return (_MSKanji_init(rl)); else - return(EINVAL); + return (EFTYPE); } |