]> arthur.barton.de Git - netatalk.git/blobdiff - etc/cnid_dbd/usockfd.c
Merge master
[netatalk.git] / etc / cnid_dbd / usockfd.c
index 30bb9e705896b610841bd71432fd0d0a6c5c5161..ff1538b340c334c2428457455c8e3cf2bfda9f21 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif /* HAVE_UNISTD_H */
 #include <sys/un.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
-
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif /* HAVE_SYS_TYPES_H */
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif /* HAVE_SYS_TIME_H */
-
 
 #include <atalk/logger.h>
 #include "usockfd.h"
@@ -65,6 +57,9 @@ int usockfd_create(char *usock_fn, mode_t mode, int backlog)
         return -1;
     }
 
+#ifdef chmod
+#undef chmod
+#endif
     if (chmod(usock_fn, mode) < 0) {
         LOG(log_error, logtype_cnid, "error changing permissions for %s: %s",
             usock_fn, strerror(errno));
@@ -152,7 +147,6 @@ int usockfd_check(int sockfd, const sigset_t *sigset)
     socklen_t size;
     fd_set readfds;
     int ret;
-    struct timeval tv;
      
     FD_ZERO(&readfds);
     FD_SET(sockfd, &readfds);
@@ -174,10 +168,6 @@ int usockfd_check(int sockfd, const sigset_t *sigset)
                 strerror(errno));
             return -1;
         }
-        if (setnonblock(fd, 1) != 0) {
-            LOG(log_error, logtype_cnid, "setnonblock: %s", strerror(errno));
-            return -1;
-        }
         return fd;
     } else
         return 0;