summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-05-24 21:00:16 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-05-24 21:00:16 (GMT)
commit38b33b83308d00f6d882bba87069e2b77fd95443 (patch)
tree0f7eb0729558ce54c03b29b3b9c33bdbe4853ce2 /tools/misc
parentf1aa157f580efc4328cf8b194822b7229a738bee (diff)
downloadhdf5-38b33b83308d00f6d882bba87069e2b77fd95443.zip
hdf5-38b33b83308d00f6d882bba87069e2b77fd95443.tar.gz
hdf5-38b33b83308d00f6d882bba87069e2b77fd95443.tar.bz2
[svn-r10795] Purpose: Bug fix
Description: See details from Bug #213. Family member file size wasn't saved anywhere in file. When family file is opened, the first member size determine the member size. Solution: This is the third step of checkin. h5repart has been modified. If h5repart is used to change the size of family member file, the new size(actual member size) is saved in the superblock. In the second step of checkin, multi driver is checked against the driver name saved in superblock. Wrong driver will result in a failure with an error message indicating multi driver should be used. This change includes split driver because it's a special case for multi driver. In the first step of checkin. Family member size and name template(unused at this stage) are saved in file superblock. When file is reopened,the size passed in thrin superblock. A different size will trigger a failure with an error message indicating the right size. Wrong driver to open family file will cause a failure, too. Platforms tested: h5committest and fuss Misc. update: RELEASE.txt
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/h5repart.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c
index 0518a76..0bd2dd8 100644
--- a/tools/misc/h5repart.c
+++ b/tools/misc/h5repart.c
@@ -223,7 +223,9 @@ main (int argc, char *argv[])
off_t src_act_size; /*source actual member size */
off_t dst_size=1 GB; /*destination logical memb size */
#endif
-
+ hid_t fapl;
+ hid_t file;
+
/*
* Get the program name from argv[0]. Use only the last component.
*/
@@ -441,7 +443,35 @@ main (int argc, char *argv[])
}
}
close (dst);
+
+ /* modify family size saved in superblock. Member size 1 signals library to
+ * save the new size(actual member file size) in superblock. It's for this
+ * tool only. */
+ if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) {
+ perror ("H5Pcreate");
+ exit (1);
+ }
+ if(H5Pset_fapl_family(fapl, 1, H5P_DEFAULT)<0) {
+ perror ("H5Pset_fapl_family");
+ exit (1);
+ }
+
+ if((file=H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl))<0) {
+ perror ("H5Fopen");
+ exit (1);
+ }
+
+ if(H5Fclose(file)<0) {
+ perror ("H5Fclose");
+ exit (1);
+ }
+
+ if(H5Pclose(fapl)<0) {
+ perror ("H5Pclose");
+ exit (1);
+ }
+
/* Free resources and return */
free (buf);
return 0;