summaryrefslogtreecommitdiff
path: root/popt
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-11-09 02:37:38 +0000
committerWayne Davison <wayned@samba.org>2006-11-09 02:37:38 +0000
commite0930845ce339fc51f607ba19bc40a8685118b91 (patch)
treec23af3d4efeed2a530e9051d61c859cc301b9cd0 /popt
parentcf817883664ae517071752b2851c2ce96eb2de29 (diff)
downloadrsync-e0930845ce339fc51f607ba19bc40a8685118b91.tar.gz
rsync-e0930845ce339fc51f607ba19bc40a8685118b91.tar.bz2
rsync-e0930845ce339fc51f607ba19bc40a8685118b91.zip
Improved the vmefail() code.
Diffstat (limited to 'popt')
-rw-r--r--popt/system.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/popt/system.h b/popt/system.h
index 8d62df85..f835a58e 100644
--- a/popt/system.h
+++ b/popt/system.h
@@ -98,13 +98,15 @@ size_t strlcat(char *d, const char *s, size_t bufsize);
#endif
#if HAVE_MCHECK_H && defined(__GNUC__)
-#define vmefail() (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL)
static inline char *
xstrdup(const char *s)
{
size_t memsize = strlen(s) + 1;
char *ptr = malloc(memsize);
- if (!ptr) vmefail();
+ if (!ptr) {
+ fprintf(stderr, "virtual memory exhausted.\n");
+ exit(EXIT_FAILURE);
+ }
strlcpy(ptr, s, memsize);
return ptr;
}