summaryrefslogtreecommitdiffstats
path: root/mount/sundries.c
diff options
context:
space:
mode:
authorKarel Zak2007-10-25 10:12:51 +0200
committerKarel Zak2007-10-25 21:50:59 +0200
commit26f95c7da28d94f663566e9d2132d4c71a1af098 (patch)
tree2bfcac3c931973d61080335b70f606f11cfe02e6 /mount/sundries.c
parentumount: use atexit() rather than (*at_die)() (diff)
downloadkernel-qcow2-util-linux-26f95c7da28d94f663566e9d2132d4c71a1af098.tar.gz
kernel-qcow2-util-linux-26f95c7da28d94f663566e9d2132d4c71a1af098.tar.xz
kernel-qcow2-util-linux-26f95c7da28d94f663566e9d2132d4c71a1af098.zip
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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mount/sundries.c b/mount/sundries.c
index 1669554c0..0c7c6e1e9 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