swapon_SOURCES = swapon.c swap_constants.h $(utils_common)
-losetup_SOURCES = lomount.c loop.h lomount.h
+losetup_SOURCES = lomount.c sundries.c xmalloc.c loop.h lomount.h xmalloc.h \
+ sundries.h
losetup_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)
mount_LDADD = $(LDADD_common)
#include "lomount.h"
#include "xstrncpy.h"
#include "nls.h"
+#include "sundries.h"
+#include "xmalloc.h"
-extern int verbose;
extern char *progname;
-extern char *xstrdup (const char *s); /* not: #include "sundries.h" */
-extern void error (const char *fmt, ...); /* idem */
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
exit(1);
}
-char *
-xstrdup (const char *s) {
- char *t;
-
- if (s == NULL)
- return NULL;
-
- t = strdup (s);
-
- if (t == NULL) {
- fprintf(stderr, _("not enough memory"));
- exit(1);
- }
-
- return t;
-}
-
-void
-error (const char *fmt, ...) {
- va_list args;
-
- va_start (args, fmt);
- vfprintf (stderr, fmt, args);
- va_end (args);
- fprintf (stderr, "\n");
-}
-
-
int
main(int argc, char **argv) {
char *p, *offset, *encryption, *passfd, *device, *file;