summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-11-12 13:57:25 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-11-12 13:57:25 (GMT)
commit10fb09658676e19e89a4fd0377fb9e5d0da35cdb (patch)
tree2dffe3025c4b69f64c2140b43025caf52fd65c5f
parentfac0c1327142486041080e47282f875d64cad740 (diff)
downloadhdf5-10fb09658676e19e89a4fd0377fb9e5d0da35cdb.zip
hdf5-10fb09658676e19e89a4fd0377fb9e5d0da35cdb.tar.gz
hdf5-10fb09658676e19e89a4fd0377fb9e5d0da35cdb.tar.bz2
[svn-r6077] Purpose:
Code cleanup Description: Added some comments and made some minor code cleanups Platforms tested: minor change, only testing on FreeBSD 4.7 (sleipnir) w/parallel
-rw-r--r--src/H5E.c2
-rw-r--r--src/H5Epublic.h2
-rw-r--r--src/H5FPclient.c18
3 files changed, 15 insertions, 7 deletions
diff --git a/src/H5E.c b/src/H5E.c
index 321a58b..260ab1c 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -89,6 +89,8 @@ static const H5E_minor_mesg_t H5E_minor_mesg_g[] = {
{H5E_CANTCOPY, "Unable to copy object"},
{H5E_CANTFREE, "Unable to free object"},
{H5E_ALREADYEXISTS, "Object already exists"},
+ {H5E_CANTLOCK, "Unable to lock object"},
+ {H5E_CANTUNLOCK, "Unable to unlock object"},
/* File accessability errors */
{H5E_FILEEXISTS, "File already exists"},
diff --git a/src/H5Epublic.h b/src/H5Epublic.h
index ef44f3a..014ff32 100644
--- a/src/H5Epublic.h
+++ b/src/H5Epublic.h
@@ -120,6 +120,8 @@ typedef enum H5E_minor_t {
H5E_CANTCOPY, /*unable to copy object */
H5E_CANTFREE, /*unable to free object */
H5E_ALREADYEXISTS, /*Object already exists */
+ H5E_CANTLOCK, /*Unable to lock object */
+ H5E_CANTUNLOCK, /*Unable to unlock object */
/* File accessability errors */
H5E_FILEEXISTS, /*file already exists */
diff --git a/src/H5FPclient.c b/src/H5FPclient.c
index 1d80514..613f780 100644
--- a/src/H5FPclient.c
+++ b/src/H5FPclient.c
@@ -21,7 +21,6 @@
#include "H5MMprivate.h" /* Memory allocation */
#include "H5Oprivate.h" /* Object Headers */
#include "H5Spkg.h" /* Dataspace functions */
-#include "H5Sprivate.h" /* Dataspaces */
#include "H5TBprivate.h" /* Threaded, Balanced, Binary Trees */
#ifdef H5_HAVE_FPHDF5
@@ -169,7 +168,15 @@ H5FP_request_lock(unsigned int sap_file_id, unsigned char *obj_oid,
* error stack...The same with the lock release below.
* -BW
*/
- HGOTO_DONE(FAIL);
+ /* FIXME: Yes, but that's like saying that failing to open a
+ * file 'is not an "error" per se' and letting the code
+ * deal with it in the next layer up. Currently,
+ * pretty much everywhere in the code assumes that when
+ * a function fails, it pushes a reason on the error
+ * stack. Changed to return error in lock release
+ * function also. - QAK
+ */
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTLOCK, FAIL, "can't lock object on server");
}
done:
@@ -236,11 +243,8 @@ H5FP_request_release_lock(unsigned int sap_file_id, unsigned char *obj_oid,
*status = sap_reply.status;
- if (sap_reply.status != H5FP_STATUS_LOCK_RELEASED) {
- HDfprintf(stderr, "Release: For some reason, we couldn't release the lock\n");
- HDfprintf(stderr, "Release: reply status == %d\n", sap_reply.status);
- HGOTO_DONE(FAIL);
- }
+ if (sap_reply.status != H5FP_STATUS_LOCK_RELEASED)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTUNLOCK, FAIL, "can't unlock object on server");
}
done: