diff options
author | Karel Zak <kzak@redhat.com> | 2007-10-25 10:12:51 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2007-10-25 21:50:59 +0200 |
commit | 26f95c7da28d94f663566e9d2132d4c71a1af098 (patch) | |
tree | 2bfcac3c931973d61080335b70f606f11cfe02e6 /mount/sundries.c | |
parent | ab9dd9385c1c517477b0cc6362fdbff763b61b6c (diff) | |
download | util-linux-old-26f95c7da28d94f663566e9d2132d4c71a1af098.tar.gz |
mount: cleanup error() and die()
* moves error() and die() to sundries.h
* removes at_die
* adds __attribute__ ((__format__ (__printf__ )))
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/sundries.c')
-rw-r--r-- | mount/sundries.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mount/sundries.c b/mount/sundries.c index 1669554c..0c7c6e1e 100644 --- a/mount/sundries.c +++ b/mount/sundries.c @@ -18,6 +18,8 @@ #include "xmalloc.h" #include "nls.h" +int mount_quiet; + char * xstrndup (const char *s, int n) { char *t; @@ -108,6 +110,19 @@ error (const char *fmt, ...) { fputc('\n', stderr); } +/* 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); + + 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 |