]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/util/socket.c
Add dtrace provider 'afp' and dtrace probes
[netatalk.git] / libatalk / util / socket.c
index c80a023d76225fddc6e69fbce5bfe803e1f57007..1df0b96bc2890bdf4e8bd9bb360211e1daecf93d 100644 (file)
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
-#if !defined(__FreeBSD__) && !defined(__NetBSD__)
-# ifndef _XOPEN_SOURCE
-#  define _XOPEN_SOURCE 600
-# endif
-# ifndef __EXTENSIONS__
-#  define __EXTENSIONS__
-# endif
-# ifndef _GNU_SOURCE
-#  define _GNU_SOURCE
-# endif
-#endif
+#include <atalk/standards.h>
+
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
+#include <sys/uio.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -112,7 +104,7 @@ ssize_t readt(int socket, void *data, const size_t length, int setnonblocking, i
     end.tv_sec += timeout;
 
     while (stored < length) {
-        len = read(socket, (char *) data + stored, length - stored);
+        len = recv(socket, (char *) data + stored, length - stored, 0);
         if (len == -1) {
             switch (errno) {
             case EINTR: