diff options
| author | Roy Marples <roy@marples.name> | 2007-04-26 16:16:56 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2007-04-26 16:16:56 +0000 |
| commit | 0731074b52e211799a419ce90462562643b4f658 (patch) | |
| tree | e5f6e97264bf4a43222ffc20996b89586faba300 /common.c | |
| parent | 6e9e8a1d4b24a11ef393a5e51cdb3542b2bece4d (diff) | |
| download | dhcpcd-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.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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); } |
