Source-Changes-HG archive

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

[src/netbsd-8]: src/usr.sbin/sysinst Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/e2a34f10d374
branches:  netbsd-8
changeset: 434977:e2a34f10d374
user:      snj <snj%NetBSD.org@localhost>
date:      Mon May 07 04:06:31 2018 +0000

description:
Pull up following revision(s) (requested by kre in ticket #801):
        usr.sbin/sysinst/partman.c: 1.20-1.21
PR install/53220
Don't call pm_lvm_find() unless have_lvm
pm_lvm_find() assumes that data structs (lvms) has been allocated
for it to use, which doesn't happen if !have_lvm
This avoids a sysinst core dump when the lvm command is not installed
(such as when installing from the embedded RAM root filesys in an
INSTALL kernel.)
--
Change return type of pm_lvm_find() from int to void.
It always returns (returned) 0 which was ignored by the one call.

diffstat:

 usr.sbin/sysinst/partman.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 2746e58e6c0a -r e2a34f10d374 usr.sbin/sysinst/partman.c
--- a/usr.sbin/sysinst/partman.c        Mon May 07 04:03:20 2018 +0000
+++ b/usr.sbin/sysinst/partman.c        Mon May 07 04:06:31 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: partman.c,v 1.15.6.2 2018/05/07 03:51:01 snj Exp $ */
+/*     $NetBSD: partman.c,v 1.15.6.3 2018/05/07 04:06:31 snj Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -1173,7 +1173,7 @@
 
 /* Add lvm logical volumes to pm list */
 /* XXX: rewrite */
-static int
+static void
 pm_lvm_find(void)
 {
        int i, ii, already_found;
@@ -1213,7 +1213,6 @@
                        memset(pm_new, 0, sizeof *pm_new);
                }
        }
-       return 0;
 }
 
 static int
@@ -2609,7 +2608,8 @@
                        pm_i->found = 0;
        /* Detect all present devices */
        (void)find_disks("partman");
-       pm_lvm_find();
+       if (have_lvm)
+               pm_lvm_find();
        pm_clean();
 
        if (m == NULL || arg == NULL)



Home | Main Index | Thread Index | Old Index