summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-08-25 11:53:26 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2017-08-25 14:20:59 +0200
commitc8fdc5c0877b137ed3ca1f217d8ef0fa89299a9a (patch)
tree14feafb60799061845a94eb5172c789089581bab
parent962874bfe2a3c3511e42fe29f0f013c780f65e63 (diff)
downloadlvm2-c8fdc5c0877b137ed3ca1f217d8ef0fa89299a9a.tar.gz
cleanup: easier to read code
Split into lines for better reading.
-rw-r--r--daemons/clvmd/clvmd-command.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/daemons/clvmd/clvmd-command.c b/daemons/clvmd/clvmd-command.c
index cf19dc24b..2971ecba5 100644
--- a/daemons/clvmd/clvmd-command.c
+++ b/daemons/clvmd/clvmd-command.c
@@ -171,8 +171,10 @@ int do_command(struct local_client *client, struct clvm_header *msg, int msglen,
/* Check the status of the command and return the error text */
if (status) {
- *retlen = 1 + ((*buf) ? dm_snprintf(*buf, buflen, "%s",
- strerror(status)) : -1);
+ if (*buf)
+ *retlen = dm_snprintf(*buf, buflen, "%s", strerror(status)) + 1;
+ else
+ *retlen = 0;
}
return status;