summaryrefslogtreecommitdiff
path: root/restripe.c
diff options
context:
space:
mode:
authorRobert Buchholz <rbu@goodpoint.de>2012-07-16 23:56:54 +0200
committerNeilBrown <neilb@suse.de>2012-09-10 17:23:59 +1000
commit1cc101f3f873fac4110aeece95bfe391fc8680c2 (patch)
treedc5c355cd1b00cc7c729c2986f7f863f23f320fe /restripe.c
parenta74e5731ba8c32f74c60e45c244735d602d14dca (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.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/restripe.c b/restripe.c
index 1d2da1ad..90896c89 100644
--- a/restripe.c
+++ b/restripe.c
@@ -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 */