diff options
author | David Teigland <teigland@redhat.com> | 2015-05-20 15:58:45 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2015-06-02 11:39:33 -0500 |
commit | 742948280162515a5294279213bc811f494268ae (patch) | |
tree | f6f115eeb3d8a5548bca8abb0a1e8f246c626ba3 | |
parent | 30e8d808ee271a4b64e9ef16dd62b37611906bf9 (diff) | |
download | lvm2-742948280162515a5294279213bc811f494268ae.tar.gz |
lib: define constant for NO_LOCKD_RESULT
-rw-r--r-- | lib/locking/lvmlockd.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c index 9820ab7f7..3c254a709 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; } |