Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 10th, 2011  |  syntax: Diff  |  size: 0.95 KB  |  views: 80  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: firmware/common/disk.c
  2. ===================================================================
  3. --- firmware/common/disk.c      (revision 29021)
  4. +++ firmware/common/disk.c      (working copy)
  5. @@ -263,19 +263,23 @@
  6.  
  7.  int disk_unmount_all(void)
  8.  {
  9. -#ifndef HAVE_MULTIDRIVE
  10. -    return disk_unmount(0);
  11. -#else  /* HAVE_MULTIDRIVE */
  12.      int unmounted = 0;
  13.      int i;
  14. -    for (i = 0; i < NUM_DRIVES; i++)
  15. +#ifdef HAVE_HOTSWAP
  16. +    mutex_lock(&disk_mutex);
  17. +#endif
  18. +    for (i=0; i<NUM_VOLUMES; i++)
  19.      {
  20. +        if(vol_drive[i] >= 0)
  21. +        {
  22. +            vol_drive[i] = -1; /* mark unused */
  23. +            unmounted++;
  24. +            release_files(i);
  25. +            release_dirs(i);
  26. +            fat_unmount(i, true);
  27. +        }
  28. +    }
  29.  #ifdef HAVE_HOTSWAP
  30. -        if (storage_present(i))
  31. +    mutex_unlock(&disk_mutex);
  32.  #endif
  33. -            unmounted += disk_unmount(i);
  34. -    }
  35.  
  36.      return unmounted;
  37. -#endif  /* HAVE_MULTIDRIVE */
  38.  }