mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 22:44:02 +08:00
libblock: Use UTF-8 converter in media manager
This commit is contained in:
@@ -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@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);
|
||||
|
||||
Reference in New Issue
Block a user