enable the async mode when mounting usb device using fat
author"Luc Saillard <luc@saillard.org>"
Mon Mar 17 19:03:07 2008 +0100 (8 weeks ago)
changeset 6903379d61af4c
parent 68efd293f65cad
child 70e58cff8af8ec
enable the async mode when mounting usb device using fat
src/mount.c
src/plugins/keyboard.c
--- a/src/mount.c Wed Feb 20 14:07:08 2008 +0100
+++ b/src/mount.c Mon Mar 17 19:03:07 2008 +0100
@@ -61,6 +61,8 @@ static const char *mount_dir = MOUNT_DIR
static const char *mount_dir = MOUNT_DIRECTORY;
+static gboolean use_async_mount = FALSE;
+
#define is_octal(x) ((x)>='0' && (x)<='7')
#define ascii_octal(x) ((x)-'0')
@@ -525,8 +527,11 @@ do_mount_mount(const char *device_path,
strcat(options_string, ",ro");
else
strcat(options_string, ",rw");
- if (mount_flags & MS_SYNCHRONOUS)
- strcat(options_string, ",sync");
+ if (use_async_mount == FALSE)
+ {
+ if (mount_flags & MS_SYNCHRONOUS)
+ strcat(options_string, ",sync");
+ }
if (options && options->extra)
{
strcat(options_string, ",");
@@ -981,6 +986,19 @@ mount_init(void)
mount_init(void)
{
GIOChannel *mounts_channel;
+ char *config_filerc = NULL;
+
+
+ /* Read 'async' option from the configuration file */
+ if (g_file_get_contents("/etc/default/minihal", &config_filerc, NULL, NULL) == TRUE)
+ {
+ if (strstr(config_filerc, "\nasync=true"))
+ use_async_mount = TRUE;
+
+ g_free(config_filerc);
+ }
+ trace("use_async_mount = %s\n", use_async_mount?"true":"false");
+
mountpoints = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, (GDestroyNotify)mountpoint_unref);
--- a/src/plugins/keyboard.c Wed Feb 20 14:07:08 2008 +0100
+++ b/src/plugins/keyboard.c Mon Mar 17 19:03:07 2008 +0100
@@ -222,7 +222,7 @@ static int
static int
alsa_volume_change(int percent_to_add)
{
- long pmin=0, pmax=0, pvol=0, confirm_vol;
+ long pmin=0, pmax=0, pvol=0;
int newvol = 0;
unsigned int chn;
int vol_in_percent = 75;