]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/simple-protocol.c
* apply patches from debian pacakge
[catta] / avahi-daemon / simple-protocol.c
index a3b48cce4c3991765cb863ad94229521849ec28c..8aa427b86639d1fd7f1a6b683acb656e2e446902 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <assert.h>
 #include <string.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <stdio.h>
 #include <unistd.h>
 #include "simple-protocol.h"
 #include "main.h"
 
+#ifdef ENABLE_CHROOT
+#include "chroot.h"
+#endif
+
 #define BUFFER_SIZE (20*1024)
 
 #define CLIENTS_MAX 50
@@ -496,7 +501,11 @@ void simple_protocol_shutdown(void) {
     if (server) {
 
         if (server->bind_successful)
+#ifdef ENABLE_CHROOT
+            avahi_chroot_helper_unlink(AVAHI_SOCKET);
+#else
             unlink(AVAHI_SOCKET);
+#endif
 
         while (server->clients)
             client_free(server->clients);