]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/simple-protocol.c
Apply fedora init script fix from http://cvs.fedora.redhat.com/viewcvs/devel/avahi...
[catta] / avahi-daemon / simple-protocol.c
index 8aa427b86639d1fd7f1a6b683acb656e2e446902..04b07c77fbff083a45183ac7b11fd5348d26dea2 100644 (file)
@@ -32,6 +32,7 @@
 #include <sys/un.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <sys/stat.h>
 
 #include <avahi-common/llist.h>
 #include <avahi-common/malloc.h>
 #include "chroot.h"
 #endif
 
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
+#ifndef PF_LOCAL
+#define PF_LOCAL PF_UNIX
+#endif
+
 #define BUFFER_SIZE (20*1024)
 
 #define CLIENTS_MAX 50
@@ -324,7 +332,7 @@ static void handle_line(Client *c, const char *s) {
             goto fail;
         client_output_printf(c, "+ Browsing ...\n");
 
-        avahi_log_debug(__FILE__": Got %s request for '%s'.", cmd, arg);
+        avahi_log_debug(__FILE__": Got %s request.", cmd);
 
     } else if (strcmp(cmd, "BROWSE-DNS-SERVERS-IPV6") == 0 && n_args == 1) {
         c->state = CLIENT_BROWSE_DNS_SERVERS;
@@ -332,7 +340,7 @@ static void handle_line(Client *c, const char *s) {
             goto fail;
         client_output_printf(c, "+ Browsing ...\n");
 
-        avahi_log_debug(__FILE__": Got %s request for '%s'.", cmd, arg);
+        avahi_log_debug(__FILE__": Got %s request.", cmd);
 
     } else if (strcmp(cmd, "BROWSE-DNS-SERVERS") == 0 && n_args == 1) {
         c->state = CLIENT_BROWSE_DNS_SERVERS;
@@ -340,7 +348,7 @@ static void handle_line(Client *c, const char *s) {
             goto fail;
         client_output_printf(c, "+ Browsing ...\n");
 
-        avahi_log_debug(__FILE__": Got %s request for '%s'.", cmd, arg);
+        avahi_log_debug(__FILE__": Got %s request.", cmd);
 
     } else {
         client_output_printf(c, "%+i Invalid command \"%s\", try \"HELP\".\n", AVAHI_ERR_INVALID_OPERATION, cmd);
@@ -470,7 +478,7 @@ int simple_protocol_setup(const AvahiPoll *poll_api) {
 
     unlink(AVAHI_SOCKET);
     
-    if (bind(server->fd, &sa, sizeof(sa)) < 0) {
+    if (bind(server->fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
         avahi_log_warn("bind(): %s", strerror(errno));
         goto fail;
     }