/* dummy */
int verbose;
-int mount_quiet;
char *progname;
const char *fsprobe_get_label_by_devname(const char *spec) { return NULL; }
#include "setproctitle.h"
#endif
-/* Quiet mode */
-int mount_quiet = 0;
-
/* True for fake mount (-f). */
static int fake = 0;
#include "xmalloc.h"
#include "nls.h"
+int mount_quiet;
+
char *
xstrndup (const char *s, int n) {
char *t;
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
#define streq(s, t) (strcmp ((s), (t)) == 0)
-/* Functions in sundries.c that are used in mount.c and umount.c */
+/* Functions in sundries.c that are used in mount.c and umount.c */
void block_signals (int how);
-void error (const char *fmt, ...);
+
+void error (const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+void die(int err, const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+
int matching_type (const char *type, const char *types);
int matching_opts (const char *options, const char *test_opts);
void *xmalloc (size_t size);
int parse_spec(const char *spec, char **name, char **value);
-void die (int errcode, const char *fmt, ...);
-
/* exit status - bits below are ORed */
#define EX_USAGE 1 /* incorrect invocation or permission */
#define EX_SYSERR 2 /* out of memory, cannot fork, ... */
int all = 0;
int verbose = 0;
int priority = -1; /* non-prioritized swap by default */
-int mount_quiet = 0;
/* If true, don't complain if the device/file doesn't exist */
int ifexists = 0;
exit (n);
}
-int mount_quiet = 0;
-
/*
* Look for an option in a comma-separated list
*/
#include "nls.h" /* _() */
#include "sundries.h" /* EX_SYSERR */
-void (*at_die)(void) = NULL;
-
-/* 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);
-
- if (at_die)
- (*at_die)();
-
- exit(err);
-}
-
static void
die_if_null(void *t) {
if (t == NULL)
-#include <sys/types.h>
-#include <stdarg.h>
+#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);
-extern void die(int err, const char *fmt, ...);
-extern void (*at_die)(void);
+
+#endif /* MOUNT_XMALLOC_H */