Changes by: szaka
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv31498/ntfstools
Modified Files:
ntfsfix.c ntfsresize.c
Log Message:
NTFS_V* version macros and ntfs_is_version_supported() added.
Modified ntfsfix and ntfsresize to use them.
Index: ntfsfix.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsfix.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -U2 -r1.38 -r1.39
--- ntfsfix.c 11 Jul 2002 16:20:34 -0000 1.38
+++ ntfsfix.c 12 Jul 2002 07:10:44 -0000 1.39
@@ -270,18 +270,5 @@
printf("NTFS volume version is %i.%i.\n\n", vol->major_ver,
vol->minor_ver);
- switch (vol->major_ver) {
- case 1:
- if (vol->minor_ver == 1 || vol->minor_ver == 2)
- break;
- else
- goto version_error;
- case 2:
- break;
- case 3:
- if (vol->minor_ver == 0 || vol->minor_ver == 1)
- break;
- /* Fall through on error. */
- default:
-version_error:
+ if (ntfs_is_version_supported(vol)) {
fprintf(stderr, "Error: Unknown NTFS version.\n");
goto error_exit;
Index: ntfsresize.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsresize.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -U2 -r1.9 -r1.10
--- ntfsresize.c 11 Jul 2002 16:20:34 -0000 1.9
+++ ntfsresize.c 12 Jul 2002 07:10:44 -0000 1.10
@@ -622,4 +622,8 @@
"please try again (or see -f option).\n");
+ if (ntfs_is_version_supported(vol))
+ perr_exit("Unknown NTFS version %d.%d detected",
+ vol->major_ver, vol->minor_ver);
+
printf("Cluster size : %u\n", vol->cluster_size);
printf("Number of clusters: %lld\n", vol->nr_clusters);
|