summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2015-05-20 15:58:45 -0500
committerDavid Teigland <teigland@redhat.com>2015-05-20 15:58:45 -0500
commit884aab9e60c67216fce88040e8c8dea96f8384cc (patch)
treec993184d9b70823465db8958ab557d1d3a82e96e
parenteff448330f21b73367461f31b4e47a46116ecfb4 (diff)
downloadlvm2-884aab9e60c67216fce88040e8c8dea96f8384cc.tar.gz
lib: define constant for NO_LOCKD_RESULT
-rw-r--r--lib/locking/lvmlockd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index dcff8215d..1e1e45fbe 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -140,6 +140,13 @@ static void _flags_str_to_lockd_flags(const char *flags_str, uint32_t *lockd_fla
* 1 success (result/lockd_flags set)
*/
+/*
+ * This is an arbitrary number that we know lvmlockd
+ * will not return. daemon_reply_int reverts to this
+ * value if it finds no result value.
+ */
+#define NO_LOCKD_RESULT -1000
+
static int _lockd_result(daemon_reply reply, int *result, uint32_t *lockd_flags)
{
int reply_result;
@@ -156,10 +163,8 @@ static int _lockd_result(daemon_reply reply, int *result, uint32_t *lockd_flags)
return 0;
}
- /* -1000 is a random number that we know is not returned. */
-
- reply_result = daemon_reply_int(reply, "op_result", -1000);
- if (reply_result == -1000) {
+ reply_result = daemon_reply_int(reply, "op_result", NO_LOCKD_RESULT);
+ if (reply_result == NO_LOCKD_RESULT) {
log_error("lockd_result no op_result");
return 0;
}