From 6e70970166702d1cdc8e25c096167e0d80ba38c9 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 15 Aug 2012 12:56:13 +0800 Subject: [PATCH] Usermode/mount - Removed sType!=NULL restriction --- Usermode/Applications/mount_src/main.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Usermode/Applications/mount_src/main.c b/Usermode/Applications/mount_src/main.c index 602aefd4..a272214e 100644 --- a/Usermode/Applications/mount_src/main.c +++ b/Usermode/Applications/mount_src/main.c @@ -6,7 +6,7 @@ #include #define MOUNTABLE_FILE "/Acess/Conf/Mountable" -#define MOUNTED_FILE "/Devices/System/VFS/Mounts" +#define MOUNTED_FILE "/Devices/system/VFS/Mounts" // === PROTOTYPES === void ShowUsage(char *ProgName); @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) // - This is cheating, isn't it? if(argc == 1) { // Dump the contents of /Devices/system/VFS/Mounts - FILE *fp = fopen("/Devices/system/VFS/Mounts", "r"); + FILE *fp = fopen(MOUNTED_FILE, "r"); char buf[1024]; int len; while( (len = fread(buf, 1024, 1, fp)) ) @@ -114,10 +114,10 @@ int main(int argc, char *argv[]) else { // Check that we were passed a filesystem type - if(sType == NULL) { - fprintf(stderr, "Please pass a filesystem type\n"); - return EXIT_FAILURE; - } +// if(sType == NULL) { +// fprintf(stderr, "Please pass a filesystem type\n"); +// return EXIT_FAILURE; +// } } // Check Device @@ -140,7 +140,10 @@ int main(int argc, char *argv[]) if(sOptions == NULL) sOptions = ""; // Let's Mount! - _SysMount(sDevice, sDir, sType, sOptions); + if( _SysMount(sDevice, sDir, sType, sOptions) ) { + if( !sType ) + fprintf(stderr, "Filesystem autodetection failed, please pass a type\n"); + } return 0; } -- 2.20.1