Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst Fix editing start and size of not yet exist...



details:   https://anonhg.NetBSD.org/src/rev/1d15a0c06263
branches:  trunk
changeset: 955800:1d15a0c06263
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Oct 12 11:23:45 2020 +0000

description:
Fix editing start and size of not yet existing outer partitions.

diffstat:

 usr.sbin/sysinst/part_edit.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r b7d9abc2aece -r 1d15a0c06263 usr.sbin/sysinst/part_edit.c
--- a/usr.sbin/sysinst/part_edit.c      Mon Oct 12 11:07:27 2020 +0000
+++ b/usr.sbin/sysinst/part_edit.c      Mon Oct 12 11:23:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: part_edit.c,v 1.21 2020/10/10 19:42:19 martin Exp $ */
+/*     $NetBSD: part_edit.c,v 1.22 2020/10/12 11:23:45 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -214,7 +214,10 @@
        struct disk_part_info pinfo;
        daddr_t max_size;
 
-       marg->parts->pscheme->get_part_info(marg->parts, marg->cur_id, &pinfo);
+       if (marg->cur_id == NO_PART ||
+           !marg->parts->pscheme->get_part_info(marg->parts, marg->cur_id,
+           &pinfo))
+               pinfo = marg->cur;
        marg->cur.start = getpartoff(marg->parts, marg->cur.start);
        max_size = marg->parts->pscheme->max_free_space_at(marg->parts,
            pinfo.start);
@@ -231,7 +234,10 @@
        struct part_edit_info *marg = arg;
        struct disk_part_info pinfo;
 
-       marg->parts->pscheme->get_part_info(marg->parts, marg->cur_id, &pinfo);
+       if (marg->cur_id == NO_PART ||
+           !marg->parts->pscheme->get_part_info(marg->parts, marg->cur_id,
+           &pinfo))
+               pinfo = marg->cur;
        marg->cur.size = getpartsize(marg->parts, pinfo.start,
            marg->cur.start, marg->cur.size);
 



Home | Main Index | Thread Index | Old Index