diff options
Diffstat (limited to 'librabbitmq/unix')
-rw-r--r-- | librabbitmq/unix/socket.c | 26 | ||||
-rw-r--r-- | librabbitmq/unix/socket.h | 25 |
2 files changed, 30 insertions, 21 deletions
diff --git a/librabbitmq/unix/socket.c b/librabbitmq/unix/socket.c index 5d339e6..cb8a2b9 100644 --- a/librabbitmq/unix/socket.c +++ b/librabbitmq/unix/socket.c @@ -30,19 +30,31 @@ * ***** END LICENSE BLOCK ***** */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif -#include <sys/types.h> -#include <sys/socket.h> -#include <unistd.h> +#include "amqp_private.h" +#include "socket.h" #include <fcntl.h> #include <stdint.h> -#include <string.h> #include <stdlib.h> +#include <string.h> +#include <sys/socket.h> +#include <sys/types.h> +#include <unistd.h> -#include "amqp.h" -#include "amqp_private.h" -#include "socket.h" +int +amqp_socket_init(void) +{ + return 0; +} + +int +amqp_socket_error(void) +{ + return errno | ERROR_CATEGORY_OS; +} int amqp_socket_socket(int domain, int type, int proto) { diff --git a/librabbitmq/unix/socket.h b/librabbitmq/unix/socket.h index af86ffb..ff6fa73 100644 --- a/librabbitmq/unix/socket.h +++ b/librabbitmq/unix/socket.h @@ -34,28 +34,25 @@ */ #include <errno.h> -#include <sys/types.h> -#include <unistd.h> -#include <sys/uio.h> -#include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #include <netinet/tcp.h> +#include <sys/socket.h> +#include <sys/types.h> +#include <sys/uio.h> +#include <unistd.h> -static inline int amqp_socket_init(void) -{ - return 0; -} +int +amqp_socket_init(void); -extern int amqp_socket_socket(int domain, int type, int proto); +int +amqp_socket_socket(int domain, int type, int proto); + +int +amqp_socket_error(void); #define amqp_socket_setsockopt setsockopt #define amqp_socket_close close #define amqp_socket_writev writev -static inline int amqp_socket_error() -{ - return errno | ERROR_CATEGORY_OS; -} - #endif |