aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-10-29 21:02:44 +0100
committerMattias Andrée <maandree@operamail.com>2014-10-29 21:02:44 +0100
commitab5184c275a05a6e6db6c95d4055b416fda4061c (patch)
tree2d5dbf63a6f7d029fac720833f730bc0e5f8ae71 /src/common.h
parentadd deps (diff)
downloadcerberus-logging-ab5184c275a05a6e6db6c95d4055b416fda4061c.tar.gz
cerberus-logging-ab5184c275a05a6e6db6c95d4055b416fda4061c.tar.bz2
cerberus-logging-ab5184c275a05a6e6db6c95d4055b416fda4061c.tar.xz
fix warnings
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/common.h b/src/common.h
index 5bcc315..09312e9 100644
--- a/src/common.h
+++ b/src/common.h
@@ -32,6 +32,13 @@
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
+
+
#ifndef VARDIR
#define VARDIR "/var"
#endif
@@ -41,13 +48,13 @@
/* ttyname is defined in <unistd.h> */
-#define ttyname tty
+#define ttyname ttyname_
#define LIST_ARGUMENTS X(action) X(username) X(ttyname) X(pid) X(hostname)
#define streq(a, b) (((a == NULL) == (b == NULL)) || (a && b && !strcmp(a, b)))
#define xstrcpy(d, s) (s ? snprintf(d, sizeof(d) / sizeof(char), "%s", s) : 0)
-#define xmemcpy(d, s) (s ? memcpy(d, s, sizeof(d)) : 0)
+#define xmemcpy(d, s) (s ? memcpy(d, s, sizeof(d)) : NULL)
@@ -65,20 +72,20 @@ static inline const char* first_digit(const char* str)
}
-static inline const char* get_hostaddress(const char* hostname)
+static const char* get_hostaddress(const char* host)
{
static char rc[32 * 4 / 8];
struct addrinfo hints;
struct addrinfo *info = NULL;
- if (hostname == NULL)
+ if (host == NULL)
return NULL;
memset(rc, 0, sizeof(rc));
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_ADDRCONFIG;
- if (getaddrinfo(hostname, NULL, &hints, &info)) return NULL;
+ if (getaddrinfo(host, NULL, &hints, &info)) return NULL;
if (info == NULL) return NULL;
if (info->ai_family == AF_INET)