diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-05-07 05:39:50 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-05-07 05:39:50 +0000 |
| commit | cbe5232fe7a8cd6eeef08686960d1878af997630 (patch) | |
| tree | 6fce52fc395fb736d500b34dc0874446c9c9d852 | |
| parent | 5880814dc3f0ef94a323035fdb978daf66882b7f (diff) | |
Notes
| -rw-r--r-- | release/sysinstall/media.c | 12 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/media.c | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c index 10bda7cc156c..b423c067c5a2 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 10bda7cc156c..b423c067c5a2 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; |
