summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/dump/main.c15
-rw-r--r--sbin/dump/optr.c5
2 files changed, 14 insertions, 6 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index 30be0c9..d7783b1 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -46,6 +46,7 @@ static const char rcsid[] =
#endif /* not lint */
#include <sys/param.h>
+#include <sys/stat.h>
#include <sys/time.h>
#ifdef sunos
#include <sys/vnode.h>
@@ -548,7 +549,19 @@ rawname(cp)
char *cp;
{
static char rawbuf[MAXPATHLEN];
- char *dp = strrchr(cp, '/');
+ char *dp;
+ struct stat sb;
+
+ if (stat(cp, &sb) == 0) {
+ /*
+ * If the name already refers to a raw device, return
+ * it immediately without tampering.
+ */
+ if ((sb.st_mode & S_IFMT) == S_IFCHR)
+ return (cp);
+ }
+
+ dp = strrchr(cp, '/');
if (dp == NULL)
return (NULL);
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index 71dd8d1..bb4c262 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -437,11 +437,6 @@ getfstab()
* Search in the fstab for a file name.
* This file name can be either the special or the path file name.
*
- * The entries in the fstab are the BLOCK special names, not the
- * character special names.
- * The caller of fstabsearch assures that the character device
- * is dumped (that is much faster)
- *
* The file name can omit the leading '/'.
*/
struct fstab *
OpenPOWER on IntegriCloud