summaryrefslogtreecommitdiffstats
path: root/support/nfs/xmalloc.c
diff options
context:
space:
mode:
authorAmit Gud <agud@redhat.com>2006-06-12 19:08:27 -0400
committerNeil Brown <neilb@suse.de>2006-06-16 12:19:45 +1000
commit4e2bae795e5eaf9922f0b966ab5df64994c836a2 (patch)
tree5bd9031586cbc3f6e644d9967d54acf00a7ebb4d /support/nfs/xmalloc.c
parenta0520fa1a41bd33815b331b660b4545f2723495c (diff)
downloadnfs-utils-4e2bae795e5eaf9922f0b966ab5df64994c836a2.tar.gz
nfs-utils-4e2bae795e5eaf9922f0b966ab5df64994c836a2.tar.xz
nfs-utils-4e2bae795e5eaf9922f0b966ab5df64994c836a2.zip
Move NFS mount code from util-linux to nfs-utils - part 2
Adds the support functions needed for mount and umount. This functionality will someday be available in the form of shared mount library. Signed-off-by: Amit Gud <agud@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfs/xmalloc.c')
-rw-r--r--support/nfs/xmalloc.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/support/nfs/xmalloc.c b/support/nfs/xmalloc.c
deleted file mode 100644
index e9fd7c7..0000000
--- a/support/nfs/xmalloc.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * support/nfs/xmalloc.c
- *
- * malloc with NULL checking.
- *
- * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "xmalloc.h"
-#include "xlog.h"
-
-void *
-xmalloc(size_t size)
-{
- void *ptr;
-
- if (!(ptr = malloc(size)))
- xlog(L_FATAL, "malloc: out of memory");
- return ptr;
-}
-
-void *
-xrealloc(void *ptr, size_t size)
-{
- if (!(ptr = realloc(ptr, size)))
- xlog(L_FATAL, "realloc: out of memory");
- return ptr;
-}
-
-void
-xfree(void *ptr)
-{
- free(ptr);
-}
-
-char *
-xstrdup(const char *str)
-{
- char *ret;
-
- if (!(ret = strdup(str)))
- xlog(L_FATAL, "strdup: out of memory");
- return ret;
-}