#include <sys/socket.h>
#include <string.h>
#include <stdio.h>
+#include <unistd.h>
#include <assert.h>
#include <errno.h> // ENOMEM
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, ...)
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);
return 0;
}
-void *client_thread(void *baton)
+static void *client_thread(void *baton)
{
struct thread_baton *b = baton;
request req;
return NULL;
}
-int handle_connect(daemon_state s)
+static int handle_connect(daemon_state s)
{
struct sockaddr_un sockaddr;
client_handle client;
s.daemon_init(&s);
while (!_shutdown_requested && !failed) {
- int status;
fd_set in;
FD_ZERO(&in);
FD_SET(s.socket_fd, &in);
#include <stdio.h>
#include <malloc.h>
#include <string.h>
+#include <unistd.h>
#include <assert.h>
#include "daemon-shared.h"
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;