diff options
author | Robert Buchholz <rbu@goodpoint.de> | 2012-07-16 23:56:54 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-09-10 17:23:59 +1000 |
commit | 1cc101f3f873fac4110aeece95bfe391fc8680c2 (patch) | |
tree | dc5c355cd1b00cc7c729c2986f7f863f23f320fe /restripe.c | |
parent | a74e5731ba8c32f74c60e45c244735d602d14dca (diff) |
Move xmalloc et al into their own file
This avoid code duplication for utilities that do not link to
util.c and everything that comes with it, such as test_restripe and
raid6check
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'restripe.c')
-rw-r--r-- | restripe.c | 22 |
1 files changed, 0 insertions, 22 deletions
@@ -998,26 +998,4 @@ main(int argc, char *argv[]) exit(0); } - -void *xmalloc(size_t len) -{ - void *rv = malloc(len); - char *msg; - if (rv) - return rv; - msg = Name ": memory allocation failure - aborting\n"; - write(2, msg, strlen(msg)); - exit(4); -} - -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"; - write(2, msg, strlen(msg)); - exit(4); -} #endif /* MAIN */ |