diff options
author | Karel Zak | 2007-10-25 10:19:12 +0200 |
---|---|---|
committer | Karel Zak | 2007-10-25 21:50:59 +0200 |
commit | 0b994f0e9355e43228301ec3cdaaee93149baa77 (patch) | |
tree | 33e9932ff49b8925f44c1957dfba3ca4369866da /mount/lomount.c | |
parent | mount: cleanup error() and die() (diff) | |
download | kernel-qcow2-util-linux-0b994f0e9355e43228301ec3cdaaee93149baa77.tar.gz kernel-qcow2-util-linux-0b994f0e9355e43228301ec3cdaaee93149baa77.tar.xz kernel-qcow2-util-linux-0b994f0e9355e43228301ec3cdaaee93149baa77.zip |
losetup: remove duplicate xstrdup() and error()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/lomount.c')
-rw-r--r-- | mount/lomount.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/mount/lomount.c b/mount/lomount.c index 737194e91..1373067cf 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -22,11 +22,10 @@ #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])) @@ -466,34 +465,6 @@ usage(void) { 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; |