summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2006-07-27 18:52:26 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2006-07-27 18:52:26 (GMT)
commite5efc2f0571dce038e120a40d9ca0dc7e901b984 (patch)
tree40cdbccaef3a8c04198da780629c1137eccf1f73 /tools
parent6a3cbe5b70b408edf6ea327a142a82366920d4f4 (diff)
downloadhdf5-e5efc2f0571dce038e120a40d9ca0dc7e901b984.zip
hdf5-e5efc2f0571dce038e120a40d9ca0dc7e901b984.tar.gz
hdf5-e5efc2f0571dce038e120a40d9ca0dc7e901b984.tar.bz2
[svn-r12510] add a test for a missing file name
test: linux
Diffstat (limited to 'tools')
-rw-r--r--tools/h5copy/h5copy.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c
index 3fc5316..a57f96a 100644
--- a/tools/h5copy/h5copy.c
+++ b/tools/h5copy/h5copy.c
@@ -228,6 +228,16 @@ main (int argc, const char *argv[])
if (!oname_src || !*oname_src)
oname_src = root_name;
+/*-------------------------------------------------------------------------
+ * test for error in opening input file
+ *-------------------------------------------------------------------------*/
+ if (fid_src==-1)
+ {
+ printf("Could not open file/object <%s>...Exiting\n",fname_src);
+ if (fname_src)
+ free(fname_src);
+ return 1;
+ }
/*-------------------------------------------------------------------------
* last argument, same logic, but the file does not exist, so we attempt to