Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst When converting partitions from one scheme ...



details:   https://anonhg.NetBSD.org/src/rev/c481e118ca4a
branches:  trunk
changeset: 984642:c481e118ca4a
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jul 14 18:56:05 2021 +0000

description:
When converting partitions from one scheme to another, never fail
without providing (if requested) a proper error message.

diffstat:

 usr.sbin/sysinst/disks.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 4871549d1674 -r c481e118ca4a usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c  Wed Jul 14 17:19:37 2021 +0000
+++ b/usr.sbin/sysinst/disks.c  Wed Jul 14 18:56:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.72 2021/01/31 22:45:46 rillig Exp $ */
+/*     $NetBSD: disks.c,v 1.73 2021/07/14 18:56:05 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -754,17 +754,23 @@
        new_scheme = select_part_scheme(p, old_parts->pscheme,
            false, MSG_select_other_partscheme);
 
-       if (new_scheme == NULL)
+       if (new_scheme == NULL) {
+               if (err_msg)
+                       *err_msg = INTERNAL_ERROR;
                return false;
+       }
 
        new_parts = new_scheme->create_new_for_disk(p->diskdev,
            0, p->dlsize, is_boot_drive, NULL);
-       if (new_parts == NULL)
+       if (new_parts == NULL) {
+               if (err_msg)
+                       *err_msg = MSG_out_of_memory;
                return false;
+       }
 
        convert_copy(old_parts, new_parts);
 
-       if (new_parts->num_part == 0) {
+       if (new_parts->num_part == 0 && old_parts->num_part != 0) {
                /* need to cleanup */
                new_parts->pscheme->free(new_parts);
                return false;



Home | Main Index | Thread Index | Old Index