Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9621/ntfsprogs
Modified Files:
ntfsmount.c
Log Message:
- Change default fsname to "ntfs#device". (Suggested by Miklos Szeredi)
- Fix error handling when no dev option given.
Index: ntfsmount.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- ntfsmount.c 3 Jul 2005 01:49:17 -0000 1.2
+++ ntfsmount.c 3 Jul 2005 12:14:57 -0000 1.3
@@ -640,11 +640,12 @@ static char *parse_options(char *options
*device = NULL;
/*
- * +10 for different in length of "fsname=... (ntfs)" and "dev=...".
+ * +8 for different in length of "fsname=ntfs#..." and "dev=...".
+ * +1 for comma
* +1 for null-terminator.
- * Total: +11
+ * Total: +10
*/
- ret = malloc(strlen(def_opts) + strlen(options) + 11);
+ ret = malloc(strlen(def_opts) + strlen(options) + 10);
if (!ret) {
perror("malloc failed");
return NULL;
@@ -701,12 +702,13 @@ static char *parse_options(char *options
strcat(ret, ",");
}
}
+ if (!*device)
+ goto err_exit;
if (!no_def_opts) {
strcat(ret, def_opts);
if (!no_fsname) {
- strcat(ret, "fsname=");
+ strcat(ret, "fsname=ntfs#");
strcat(ret, *device);
- strcat(ret, " (ntfs)");
}
}
exit:
@@ -729,7 +731,7 @@ static void usage(void)
"\tkernel_cache\n\tlarge_read\n\tdirect_io\n\tmax_read\n\t"
"fsname\n\tro\n\tno_def_opts\n\tumask\n\tfmask\n\tdmask\n\t"
"uid\n\tgid\n\tshow_system_files\n\tdev\n\n");
- Eprintf("Default options are: \"%sfsname=device (ntfs)\".\n", def_opts);
+ Eprintf("Default options are: \"%sfsname=ntfs#device\".\n", def_opts);
}
int main(int argc, char *argv[])
@@ -760,15 +762,15 @@ int main(int argc, char *argv[])
ntfs_fuse_init();
/* Parse options. */
parsed_options = parse_options(options, &device);
- if (!parsed_options) {
- ntfs_fuse_destroy();
- return 6;
- }
if (!device) {
Eprintf("dev option is mandatory.\n");
ntfs_fuse_destroy();
return 5;
}
+ if (!parsed_options) {
+ ntfs_fuse_destroy();
+ return 6;
+ }
/* Create filesystem. */
ffd = fuse_mount(mnt_point, parsed_options);
|