summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-10-09 23:19:27 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-10-09 23:19:27 +0000
commitc845589540a69a246a4039619652b9564e2934fc (patch)
tree2e29f8b3c46dda28b13400eadba8c5c52f40a8ce
parentbe549a5de4c9bd14b798d181d6654b123f22c79e (diff)
do not coredump if can't get raw device name, e.g. /tmp on mfs; millert@ ok
-rw-r--r--sbin/dump/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index e0c6c396249..19fab46782a 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.28 2000/01/04 02:53:49 millert Exp $ */
+/* $OpenBSD: main.c,v 1.29 2000/10/09 23:19:26 mickey Exp $ */
/* $NetBSD: main.c,v 1.14 1997/06/05 11:13:24 lukem Exp $ */
/*-
@@ -350,6 +350,11 @@ main(argc, argv)
if (!statfs(disk, &fsbuf) && !strcmp(fsbuf.f_mntonname, disk)) {
/* mounted disk? */
disk = rawname(fsbuf.f_mntfromname);
+ if (!disk) {
+ (void)fprintf(stderr, "cannot get raw name for %s\n",
+ fsbuf.f_mntfromname);
+ exit(X_STARTUP);
+ }
mount_point = fsbuf.f_mntonname;
(void)strlcpy(spcl.c_dev, fsbuf.f_mntfromname,
sizeof(spcl.c_dev));