summaryrefslogtreecommitdiffstats
path: root/common.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-26 16:16:56 +0000
committerRoy Marples <roy@marples.name>2007-04-26 16:16:56 +0000
commit0731074b52e211799a419ce90462562643b4f658 (patch)
treee5f6e97264bf4a43222ffc20996b89586faba300 /common.c
parent6e9e8a1d4b24a11ef393a5e51cdb3542b2bece4d (diff)
downloaddhcpcd-0731074b52e211799a419ce90462562643b4f658.tar.xz
Send a FQDN hostname if it contains dots, strip the domain from a looked up hostname if it matches our domain or search and sanitize our fd's a little better.
Diffstat (limited to 'common.c')
-rw-r--r--common.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/common.c b/common.c
index bbddf3cd..c609abaa 100644
--- a/common.c
+++ b/common.c
@@ -104,6 +104,20 @@ void *xmalloc (size_t size)
return value;
logger (LOG_ERR, "memory exhausted");
- exit (1);
+ exit (EXIT_FAILURE);
+}
+
+char *xstrdup (const char *str)
+{
+ char *value;
+
+ if (! str)
+ return (NULL);
+
+ if ((value = strdup (str)))
+ return (value);
+
+ logger (LOG_ERR, "memory exhausted");
+ exit (EXIT_FAILURE);
}