diff options
author | Mike Snitzer <snitzer@redhat.com> | 2009-04-29 15:26:16 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2009-04-29 15:26:16 -0400 |
commit | 7cb9418355fb2845b39bd187f39838b7ca241f94 (patch) | |
tree | 0b1f5d09b887ba640282203e1fdb7b5de24b51cd | |
parent | 64e1404991119d9d80090dafffa1962bc349c7c9 (diff) | |
download | multipath-tools-7cb9418355fb2845b39bd187f39838b7ca241f94.tar.gz multipath-tools-7cb9418355fb2845b39bd187f39838b7ca241f94.tar.bz2 multipath-tools-7cb9418355fb2845b39bd187f39838b7ca241f94.zip |
fix small issues in cli_handlers
- properly check cli_list_wildcards()'s MALLOC returned pointer
- add missing newline to "blacklisted" reply
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r-- | multipathd/cli_handlers.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index 42034ee..71a73ff 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -231,7 +231,7 @@ cli_list_wildcards (void * v, char ** reply, int * len, void * data) *reply = MALLOC(INITIAL_REPLY_LEN); - if (!reply) + if (!*reply) return 1; c = *reply; @@ -359,7 +359,7 @@ cli_add_path (void * v, char ** reply, int * len, void * data) if (filter_devnode(conf->blist_devnode, conf->elist_devnode, param) > 0 || (r = ev_add_path(param, vecs)) == 2) { - *reply = strdup("blacklisted"); + *reply = strdup("blacklisted\n"); *len = strlen(*reply) + 1; condlog(2, "%s: path blacklisted", param); return 0; @@ -390,7 +390,7 @@ cli_add_map (void * v, char ** reply, int * len, void * data) condlog(2, "%s: add map (operator)", param); if (filter_wwid(conf->blist_wwid, conf->elist_wwid, param) > 0) { - *reply = strdup("blacklisted"); + *reply = strdup("blacklisted\n"); *len = strlen(*reply) + 1; condlog(2, "%s: map blacklisted", param); return 0; |