dist_man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
# generic sources for all programs (mount, umount, losetup)
-srcs_common = sundries.c xmalloc.c $(top_srcdir)/lib/canonicalize.c sundries.h xmalloc.h
+srcs_common = sundries.c $(top_srcdir)/lib/canonicalize.c sundries.h
# generic header for mount and umount
hdrs_mount = fstab.h mount_mntent.h mount_constants.h \
#include <sys/time.h>
#include <time.h>
#include <mntent.h>
+
#include "mount_mntent.h"
#include "fstab.h"
#include "sundries.h"
-#include "xmalloc.h"
#include "fsprobe.h"
#include "pathnames.h"
#include "nls.h"
#include "strutils.h"
#include "nls.h"
#include "sundries.h"
-#include "xmalloc.h"
#include "pathnames.h"
#ifdef LOOP_SET_FD
#include "devname.h"
#include "mount_constants.h"
#include "sundries.h"
-#include "xmalloc.h"
#include "mount_mntent.h"
#include "fstab.h"
#include "lomount.h"
#include "canonicalize.h"
#include "sundries.h"
-#include "xmalloc.h"
#include "nls.h"
int mount_quiet;
#include <stdarg.h>
#include <stdlib.h>
+#define XALLOC_EXIT_CODE 2 /* same as EX_SYSERR, for backwards compatibility */
+#include "xalloc.h"
+
/* global mount, umount, and losetup variables */
extern int mount_quiet;
extern int verbose;
extern char *progname;
#define streq(s, t) (strcmp ((s), (t)) == 0)
+#define my_free(_p) free((void *) _p)
void block_signals (int how);
int matching_type (const char *type, const char *types);
int matching_opts (const char *options, const char *test_opts);
-void *xmalloc (size_t size);
-char *xstrdup (const char *s);
char *xstrndup (const char *s, int n);
char *xstrconcat3 (char *, const char *, const char *);
char *xstrconcat4 (char *, const char *, const char *, const char *);
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/mount.h>
+
#include "mount_constants.h"
#include "sundries.h"
#include "getusername.h"
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h> /* strdup() */
-#include "xmalloc.h"
-#include "nls.h" /* _() */
-#include "sundries.h" /* EX_SYSERR */
-
-static void
-die_if_null(void *t) {
- if (t == NULL)
- die(EX_SYSERR, _("not enough memory"));
-}
-
-void *
-xmalloc (size_t size) {
- void *t;
-
- if (size == 0)
- return NULL;
-
- t = malloc(size);
- die_if_null(t);
-
- return t;
-}
-
-void *
-xrealloc (void *p, size_t size) {
- void *t;
-
- t = realloc(p, size);
- die_if_null(t);
-
- return t;
-}
-
-char *
-xstrdup (const char *s) {
- char *t;
-
- if (s == NULL)
- return NULL;
-
- t = strdup(s);
- die_if_null(t);
-
- return t;
-}
+++ /dev/null
-#ifndef MOUNT_XMALLOC_H
-#define MOUNT_XMALLOC_H
-
-extern void *xmalloc(size_t size);
-extern void *xrealloc(void *p, size_t size);
-extern char *xstrdup(const char *s);
-
-/*
- * free(p); when 'p' is 'const char *' makes gcc unhappy:
- * warning: passing argument 1 of ‘free’ discards qualifiers from pointer target type
- */
-#define my_free(_p) free((void *) _p)
-
-#endif /* MOUNT_XMALLOC_H */