[Openais] [lck 3/4] test lockFlags in saLckResourceLock(Async)

Jan Friesse jfriesse at redhat.com
Thu Jun 4 09:12:15 PDT 2009


---
 trunk/lib/lck.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/trunk/lib/lck.c b/trunk/lib/lck.c
index 6a43447..4b453fb 100644
--- a/trunk/lib/lck.c
+++ b/trunk/lib/lck.c
@@ -778,6 +778,11 @@ saLckResourceLock (
 		goto error_exit;
 	}
 
+	if ((lockFlags & (~SA_LCK_LOCK_NO_QUEUE) & (~SA_LCK_LOCK_ORPHAN)) != 0) {
+		error = SA_AIS_ERR_BAD_FLAGS;
+		goto error_exit;
+	}
+
 	error = hdb_error_to_sa (hdb_handle_get (&lckResourceHandleDatabase,
 		lckResourceHandle, (void *)&lckResourceInstance));
 	if (error != SA_AIS_OK) {
@@ -909,6 +914,11 @@ saLckResourceLockAsync (
 		goto error_exit;
 	}
 
+	if ((lockFlags & (~SA_LCK_LOCK_NO_QUEUE) & (~SA_LCK_LOCK_ORPHAN)) != 0) {
+		error = SA_AIS_ERR_BAD_FLAGS;
+		goto error_exit;
+	}
+
 	error = hdb_error_to_sa (hdb_handle_get (&lckResourceHandleDatabase,
 		lckResourceHandle, (void *)&lckResourceInstance));
 	if (error != SA_AIS_OK) {
-- 
1.5.5.6



More information about the Openais mailing list