]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - mount/sundries.c
Imported from util-linux-2.12o tarball.
[thirdparty/util-linux.git] / mount / sundries.c
index 2118ce285e93823cb32e91865a04e35a0959657b..1be9099ba49de06ea76abc1f7a49afc16dcac8c3 100644 (file)
 #include "nfsmount.h"
 #include "nls.h"
 
-void *
-xmalloc (size_t size) {
-     void *t;
-
-     if (size == 0)
-          return NULL;
-
-     t = malloc (size);
-     if (t == NULL)
-          die (EX_SYSERR, _("not enough memory"));
-
-     return t;
-}
-
-void *
-xrealloc (void *p, size_t size) {
-     void *t;
-
-     t = realloc(p, size);
-     if (t == NULL)
-         die (EX_SYSERR, _("not enough memory"));
-
-     return t;
-}
-
-char *
-xstrdup (const char *s) {
-     char *t;
-
-     if (s == NULL)
-          return NULL;
-
-     t = strdup (s);
-
-     if (t == NULL)
-          die (EX_SYSERR, _("not enough memory"));
-
-     return t;
-}
-
 char *
 xstrndup (const char *s, int n) {
      char *t;
@@ -147,20 +107,6 @@ error (const char *fmt, ...) {
      free (fmt2);
 }
 
-/* Fatal error.  Print message and exit.  */
-void
-die (int err, const char *fmt, ...) {
-     va_list args;
-
-     va_start (args, fmt);
-     vfprintf (stderr, fmt, args);
-     fprintf (stderr, "\n");
-     va_end (args);
-
-     unlock_mtab ();
-     exit (err);
-}
-
 /* True if fstypes match.  Null *TYPES means match anything,
    except that swap types always return false. */
 /* Accept nonfs,proc,devpts and nonfs,noproc,nodevpts