diff options
author | Daniel Schauenberg <d@unwiredcouch.com> | 2011-02-02 00:51:22 +0100 |
---|---|---|
committer | Daniel Schauenberg <d@unwiredcouch.com> | 2011-02-02 00:51:22 +0100 |
commit | cb05151b4dc324fd1b1cb5bc088a214a34f55a37 (patch) | |
tree | 36acb765be0867837531d261eed9f65539c2abf5 /librabbitmq/unix | |
parent | 6d721316c72dfa18809e6c02e02403042773f023 (diff) | |
download | rabbitmq-c-github-ask-cb05151b4dc324fd1b1cb5bc088a214a34f55a37.tar.gz |
move strdup to separate file and add guards
Diffstat (limited to 'librabbitmq/unix')
-rw-r--r-- | librabbitmq/unix/socket.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/librabbitmq/unix/socket.c b/librabbitmq/unix/socket.c index 4f5368e..1edc52f 100644 --- a/librabbitmq/unix/socket.c +++ b/librabbitmq/unix/socket.c @@ -59,6 +59,10 @@ #include "amqp_private.h" #include "socket.h" +#ifndef _GNU_SOURCE +#include "utils/strdup.h" +#endif + int amqp_socket_socket(int domain, int type, int proto) { int flags; @@ -80,12 +84,6 @@ int amqp_socket_socket(int domain, int type, int proto) return s; } -/* strdup is not in ISO C90! */ -static inline char *strdup(const char *str) -{ - return strcpy(malloc(strlen(str) + 1),str); -} - char *amqp_os_error_string(int err) { return strdup(strerror(err)); |