aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Grosbein <eugen@FreeBSD.org>2018-10-27 16:41:34 +0000
committerEugene Grosbein <eugen@FreeBSD.org>2018-10-27 16:41:34 +0000
commita9dea3d2baebf26f19e1aa201d8e9dfaf114ad70 (patch)
treedbfba37a3e0eb49732bf28ba5d7fc6c3cec61964
parent6d305ab0b289686aeab9774cae15ef1e2da5c7be (diff)
downloadsrc-a9dea3d2baebf26f19e1aa201d8e9dfaf114ad70.tar.gz
src-a9dea3d2baebf26f19e1aa201d8e9dfaf114ad70.zip
mount_msdosfs: do not fail mounts requiring locale name conversion table
that is already present in a kernel statically. For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error "mount_msdosfs: msdosfs_iconv: File exists" for a kernel having options LIBICONV and MSDOSFS_ICONV. After this change, it mounts successfully. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D16951
Notes
Notes: svn path=/head/; revision=339816
-rw-r--r--sbin/mount_msdosfs/mount_msdosfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/mount_msdosfs/mount_msdosfs.c b/sbin/mount_msdosfs/mount_msdosfs.c
index d439ba671b83..36be6a161ecf 100644
--- a/sbin/mount_msdosfs/mount_msdosfs.c
+++ b/sbin/mount_msdosfs/mount_msdosfs.c
@@ -46,6 +46,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <err.h>
+#include <errno.h>
#include <grp.h>
#include <locale.h>
#include <pwd.h>
@@ -308,17 +309,17 @@ set_charset(struct iovec **iov, int *iovlen, const char *cs_local, const char *c
build_iovec_argf(iov, iovlen, "cs_win", ENCODING_UNICODE);
error = kiconv_add_xlat16_cspairs(ENCODING_UNICODE, cs_local);
- if (error)
+ if (error && errno != EEXIST)
return (-1);
if (cs_dos != NULL) {
error = kiconv_add_xlat16_cspairs(cs_dos, cs_local);
- if (error)
+ if (error && errno != EEXIST)
return (-1);
} else {
build_iovec_argf(iov, iovlen, "cs_dos", cs_local);
error = kiconv_add_xlat16_cspair(cs_local, cs_local,
KICONV_FROM_UPPER | KICONV_LOWER);
- if (error)
+ if (error && errno != EEXIST)
return (-1);
}