aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-11-09 02:29:43 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-11-09 02:29:43 +0000
commitdcf5bc078f7826ac9a3ede74e4d8fa8a208bb5c4 (patch)
tree81dc29629bfd83dce7a643aa778c89fa94184b91
parent53862ffce27f41e047c9142e9fb8ff0048951e65 (diff)
Notes
-rw-r--r--sbin/gpt/gpt.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/gpt/gpt.c b/sbin/gpt/gpt.c
index b45cfd104cc5..2aa1015378cc 100644
--- a/sbin/gpt/gpt.c
+++ b/sbin/gpt/gpt.c
@@ -585,10 +585,16 @@ gpt_open(const char *dev)
if (gpt_mbr(fd, 0LL) == -1)
goto close;
- if (gpt_gpt(fd, 1LL) == -1)
- goto close;
- if (gpt_gpt(fd, mediasz / secsz - 1LL) == -1)
- goto close;
+
+ /*
+ * Don't look for a GPT unless we have a valid PMBR.
+ */
+ if (map_find(MAP_TYPE_PMBR) != NULL) {
+ if (gpt_gpt(fd, 1LL) == -1)
+ goto close;
+ if (gpt_gpt(fd, mediasz / secsz - 1LL) == -1)
+ goto close;
+ }
return (fd);