From: Petr Rockai Date: Wed, 31 Aug 2011 12:18:40 +0000 (+0000) Subject: Fix warnings in daemons/common. X-Git-Tag: v2_02_91~622 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=6e4e30827ddad5772daf53c2c6f74b15d3ad3174;p=lvm2.git Fix warnings in daemons/common. --- diff --git a/daemons/common/daemon-client.c b/daemons/common/daemon-client.c index 3edcb8bd0..f3a50c27e 100644 --- a/daemons/common/daemon-client.c +++ b/daemons/common/daemon-client.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include // ENOMEM @@ -53,7 +54,7 @@ daemon_reply daemon_send(daemon_handle h, daemon_request rq) void daemon_reply_destroy(daemon_reply r) { if (r.cft) - destroy_config_tree(r.cft); + dm_config_destroy(r.cft); } daemon_reply daemon_send_simple(daemon_handle h, char *id, ...) diff --git a/daemons/common/daemon-server.c b/daemons/common/daemon-server.c index 468bdc17c..9ec14a7b2 100644 --- a/daemons/common/daemon-server.c +++ b/daemons/common/daemon-server.c @@ -218,14 +218,14 @@ struct thread_baton { client_handle client; }; -int buffer_rewrite(char **buf, const char *format, const char *string) { +static int buffer_rewrite(char **buf, const char *format, const char *string) { char *old = *buf; dm_asprintf(buf, format, *buf, string); dm_free(old); return 0; } -int buffer_line(const char *line, void *baton) { +static int buffer_line(const char *line, void *baton) { response *r = baton; if (r->buffer) buffer_rewrite(&r->buffer, "%s\n%s", line); @@ -234,7 +234,7 @@ int buffer_line(const char *line, void *baton) { return 0; } -void *client_thread(void *baton) +static void *client_thread(void *baton) { struct thread_baton *b = baton; request req; @@ -266,7 +266,7 @@ fail: return NULL; } -int handle_connect(daemon_state s) +static int handle_connect(daemon_state s) { struct sockaddr_un sockaddr; client_handle client; @@ -345,7 +345,6 @@ void daemon_start(daemon_state s) s.daemon_init(&s); while (!_shutdown_requested && !failed) { - int status; fd_set in; FD_ZERO(&in); FD_SET(s.socket_fd, &in); diff --git a/daemons/common/daemon-shared.c b/daemons/common/daemon-shared.c index ebaa27ee1..75f8b3a01 100644 --- a/daemons/common/daemon-shared.c +++ b/daemons/common/daemon-shared.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "daemon-shared.h" @@ -80,7 +81,7 @@ char *format_buffer(const char *what, const char *id, va_list ap) dm_asprintf(&buffer, "%s = \"%s\"\n", what, id); if (!buffer) goto fail; - while (next = va_arg(ap, char *)) { + while ((next = va_arg(ap, char *))) { old = buffer; assert(strchr(next, '=')); keylen = strchr(next, '=') - next;