summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1999-05-07 05:39:50 +0000
committerjkh <jkh@FreeBSD.org>1999-05-07 05:39:50 +0000
commite08d6acb92a1dd7bff13de20ea9ed811caa56bbe (patch)
tree4318009fee1106c41967bf04c28dc1876e4547a1
parentdb57f06b0f140c660e99f78782495bfe567d062e (diff)
downloadFreeBSD-src-e08d6acb92a1dd7bff13de20ea9ed811caa56bbe.zip
FreeBSD-src-e08d6acb92a1dd7bff13de20ea9ed811caa56bbe.tar.gz
Use a more correct filesystem type name if given a "UFS" mountpoint that's
not really UFS. PR: 10711
-rw-r--r--release/sysinstall/media.c12
-rw-r--r--usr.sbin/sysinstall/media.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c
index 10bda7c..b423c06 100644
--- a/release/sysinstall/media.c
+++ b/release/sysinstall/media.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: media.c,v 1.96 1999/02/15 00:49:33 jkh Exp $
+ * $Id: media.c,v 1.97 1999/03/10 21:59:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -39,6 +39,7 @@
#include <netdb.h>
#include <sys/socket.h>
#include <sys/param.h>
+#include <sys/mount.h>
#include <sys/errno.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
@@ -440,6 +441,7 @@ int
mediaSetUFS(dialogMenuItem *self)
{
static Device ufsDevice;
+ struct statfs st;
char *cp;
mediaClose();
@@ -448,7 +450,13 @@ mediaSetUFS(dialogMenuItem *self)
"containing the FreeBSD distribution files:", 0);
if (!cp)
return DITEM_FAILURE;
- strcpy(ufsDevice.name, "ufs");
+
+ /* If they gave us a CDROM or something, try and pick a better name */
+ if (statfs(cp, &st))
+ strcpy(ufsDevice.name, "ufs");
+ else
+ strcpy(ufsDevice.name, st.f_fstypename);
+
ufsDevice.type = DEVICE_TYPE_UFS;
ufsDevice.init = dummyInit;
ufsDevice.get = mediaGetUFS;
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c
index 10bda7c..b423c06 100644
--- a/usr.sbin/sysinstall/media.c
+++ b/usr.sbin/sysinstall/media.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: media.c,v 1.96 1999/02/15 00:49:33 jkh Exp $
+ * $Id: media.c,v 1.97 1999/03/10 21:59:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -39,6 +39,7 @@
#include <netdb.h>
#include <sys/socket.h>
#include <sys/param.h>
+#include <sys/mount.h>
#include <sys/errno.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
@@ -440,6 +441,7 @@ int
mediaSetUFS(dialogMenuItem *self)
{
static Device ufsDevice;
+ struct statfs st;
char *cp;
mediaClose();
@@ -448,7 +450,13 @@ mediaSetUFS(dialogMenuItem *self)
"containing the FreeBSD distribution files:", 0);
if (!cp)
return DITEM_FAILURE;
- strcpy(ufsDevice.name, "ufs");
+
+ /* If they gave us a CDROM or something, try and pick a better name */
+ if (statfs(cp, &st))
+ strcpy(ufsDevice.name, "ufs");
+ else
+ strcpy(ufsDevice.name, st.f_fstypename);
+
ufsDevice.type = DEVICE_TYPE_UFS;
ufsDevice.init = dummyInit;
ufsDevice.get = mediaGetUFS;
OpenPOWER on IntegriCloud