[rtems commit] libblock: Use UTF-8 converter in media manager
Sebastian Huber
sebh at rtems.org
Tue Jun 4 11:51:10 UTC 2013
Module: rtems
Branch: master
Commit: cffa5b78387e28b1a5b1d1674ec7854f6ebd8246
Changeset: http://git.rtems.org/rtems/commit/?id=cffa5b78387e28b1a5b1d1674ec7854f6ebd8246
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Jun 4 13:56:19 2013 +0200
libblock: Use UTF-8 converter in media manager
---
cpukit/libblock/src/media.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/cpukit/libblock/src/media.c b/cpukit/libblock/src/media.c
index e533ec4..c4415e4 100644
--- a/cpukit/libblock/src/media.c
+++ b/cpukit/libblock/src/media.c
@@ -7,10 +7,10 @@
*/
/*
- * Copyright (c) 2009-2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems at embedded-brains.de>
@@ -29,6 +29,7 @@
#include <rtems/blkdev.h>
#include <rtems/bdpart.h>
#include <rtems/libio.h>
+#include <rtems/dosfs.h>
#include <rtems/media.h>
@@ -472,6 +473,7 @@ static rtems_status_code mount_worker(
int rv = 0;
if (state == RTEMS_MEDIA_STATE_READY) {
+ rtems_dosfs_mount_options mount_options;
char *mount_path = NULL;
if (worker_arg == NULL) {
@@ -491,12 +493,17 @@ static rtems_status_code mount_worker(
return RTEMS_IO_ERROR;
}
+ memset(&mount_options, 0, sizeof(mount_options));
+
+ /* In case this fails, we fall back to use the default converter */
+ mount_options.converter = rtems_dosfs_create_utf8_converter("CP850");
+
rv = mount(
src,
mount_path,
RTEMS_FILESYSTEM_TYPE_DOSFS,
RTEMS_FILESYSTEM_READ_WRITE,
- NULL
+ &mount_options
);
if (rv != 0) {
rmdir(mount_path);
More information about the vc
mailing list