diff options
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 40 |
1 files changed, 0 insertions, 40 deletions
@@ -1807,43 +1807,3 @@ struct mdinfo *container_choose_spares(struct supertype *st, } return disks; } - -void *xmalloc(size_t len) -{ - void *rv = malloc(len); - char *msg; - if (rv) - return rv; - msg = Name ": memory allocation failure - aborting\n"; - exit(4+!!write(2, msg, strlen(msg))); -} - -void *xrealloc(void *ptr, size_t len) -{ - void *rv = realloc(ptr, len); - char *msg; - if (rv) - return rv; - msg = Name ": memory allocation failure - aborting\n"; - exit(4+!!write(2, msg, strlen(msg))); -} - -void *xcalloc(size_t num, size_t size) -{ - void *rv = calloc(num, size); - char *msg; - if (rv) - return rv; - msg = Name ": memory allocation failure - aborting\n"; - exit(4+!!write(2, msg, strlen(msg))); -} - -char *xstrdup(const char *str) -{ - char *rv = strdup(str); - char *msg; - if (rv) - return rv; - msg = Name ": memory allocation failure - aborting\n"; - exit(4+!!write(2, msg, strlen(msg))); -} |