Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/gpt Fix stray paste, noted by kre.
details: https://anonhg.NetBSD.org/src/rev/71ce5073f5a4
branches: trunk
changeset: 342020:71ce5073f5a4
user: christos <christos%NetBSD.org@localhost>
date: Thu Dec 03 02:09:20 2015 +0000
description:
Fix stray paste, noted by kre.
diffstat:
sbin/gpt/resizedisk.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diffs (39 lines):
diff -r 4c020cd88f7e -r 71ce5073f5a4 sbin/gpt/resizedisk.c
--- a/sbin/gpt/resizedisk.c Thu Dec 03 02:02:43 2015 +0000
+++ b/sbin/gpt/resizedisk.c Thu Dec 03 02:09:20 2015 +0000
@@ -33,7 +33,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
#endif
#ifdef __RCSID
-__RCSID("$NetBSD: resizedisk.c,v 1.13 2015/12/03 02:02:43 christos Exp $");
+__RCSID("$NetBSD: resizedisk.c,v 1.14 2015/12/03 02:09:20 christos Exp $");
#endif
#include <sys/bootblock.h>
@@ -174,19 +174,18 @@
newloc = sector;
else
newloc = last;
+
if ((p = calloc(1, gpt->secsz)) == NULL) {
- gpt_warn(gpt, "Error allocating secondary GPT");
+ gpt_warn(gpt, "Error allocating secondary GPT header");
return -1;
}
- if (gpt->lbt == NULL) {
- gpt_warn(gpt, "Error adding secondary GPT");
+
+ gpt->tpg = map_add(gpt, newloc, 1LL, MAP_TYPE_SEC_GPT_HDR, p);
+ if (gpt->tpg == NULL) {
+ gpt_warn(gpt, "Error adding secondary GPT header");
return -1;
}
- gpt->tpg = map_add(gpt, newloc, 1LL, MAP_TYPE_SEC_GPT_HDR, p);
- if (gpt->lbt == NULL) {
- gpt_warn(gpt, "Error adding secondary GPT");
- return -1;
- }
+
// XXX: map add with non-allocated memory
gpt->lbt = map_add(gpt, newloc - gpt_size, gpt_size,
MAP_TYPE_SEC_GPT_TBL, gpt->tbl->map_data);
Home |
Main Index |
Thread Index |
Old Index