Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/33554f7ca6e4
branches:  netbsd-9
changeset: 1002355:33554f7ca6e4
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Aug 19 04:52:10 2021 +0000

description:
Pull up following revision(s) (requested by martin in ticket #1333):
        usr.sbin/sysinst/defs.h: revision 1.72
        usr.sbin/sysinst/disks.c: revision 1.75
        usr.sbin/sysinst/upgrade.c: revision 1.18
PR 56354: all actions to set up swap space are not guaranteed to gain
us enough virtual memory anyway, so drop return codes from set_swap*.
The state for cleanup (which swap dev to unuse) has been made global
some time ago anyway.
Previously use of the return values was inconsistent. Error reporting
will only confuse users and sometimes the situation is hard to fix or
even impossible (like in miniroots copide to swap space for booting).

diffstat:

 usr.sbin/sysinst/defs.h    |  11 +++--------
 usr.sbin/sysinst/disks.c   |  19 +++++++------------
 usr.sbin/sysinst/upgrade.c |   5 ++---
 3 files changed, 12 insertions(+), 23 deletions(-)

diffs (97 lines):

diff -r d30c1a019ea9 -r 33554f7ca6e4 usr.sbin/sysinst/defs.h
--- a/usr.sbin/sysinst/defs.h   Sun Aug 15 09:30:14 2021 +0000
+++ b/usr.sbin/sysinst/defs.h   Thu Aug 19 04:52:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.42.2.8 2020/10/15 19:36:51 bouyer Exp $     */
+/*     $NetBSD: defs.h,v 1.42.2.9 2021/08/19 04:52:10 snj Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -696,13 +696,8 @@
 int    make_filesystems(struct install_partition_desc *);
 int    make_fstab(struct install_partition_desc *);
 int    mount_disks(struct install_partition_desc *);
-/*
- * set_swap_if_low_ram and set_swap return -1 on error,
- * 0 if no swap was added on purpose and
- * 1 if swap has been added (and needs to be cleared later).
- */
-int    set_swap_if_low_ram(struct install_partition_desc *);
-int    set_swap(struct install_partition_desc *);
+void   set_swap_if_low_ram(struct install_partition_desc *);
+void   set_swap(struct install_partition_desc *);
 void   clear_swap(void);
 int    check_swap(const char *, int);
 char *bootxx_name(struct install_partition_desc *);
diff -r d30c1a019ea9 -r 33554f7ca6e4 usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c  Sun Aug 15 09:30:14 2021 +0000
+++ b/usr.sbin/sysinst/disks.c  Thu Aug 19 04:52:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.44.2.15 2020/10/15 19:36:50 bouyer Exp $ */
+/*     $NetBSD: disks.c,v 1.44.2.16 2021/08/19 04:52:10 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1915,16 +1915,15 @@
 
 static char swap_dev[PATH_MAX];
 
-int
+void
 set_swap_if_low_ram(struct install_partition_desc *install)
 {
        swap_dev[0] = 0;
        if (get_ramsize() <= TINY_RAM_SIZE)
-               return set_swap(install);
-       return 0;
+               set_swap(install);
 }
 
-int
+void
 set_swap(struct install_partition_desc *install)
 {
        size_t i;
@@ -1936,20 +1935,16 @@
                        break;
        }
        if (i >= install->num)
-               return 0;
+               return;
 
        if (!install->infos[i].parts->pscheme->get_part_device(
            install->infos[i].parts, install->infos[i].cur_part_id, swap_dev,
            sizeof swap_dev, NULL, plain_name, true, true))
-               return -1;
+               return;
 
        rval = swapctl(SWAP_ON, swap_dev, 0);
-       if (rval != 0) {
+       if (rval != 0)
                swap_dev[0] = 0;
-               return -1;
-       }
-
-       return 1;
 }
 
 void
diff -r d30c1a019ea9 -r 33554f7ca6e4 usr.sbin/sysinst/upgrade.c
--- a/usr.sbin/sysinst/upgrade.c        Sun Aug 15 09:30:14 2021 +0000
+++ b/usr.sbin/sysinst/upgrade.c        Thu Aug 19 04:52:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: upgrade.c,v 1.12.2.3 2020/02/10 21:39:37 bouyer Exp $  */
+/*     $NetBSD: upgrade.c,v 1.12.2.4 2021/08/19 04:52:10 snj Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -81,8 +81,7 @@
                install.cur_system = true;
        }
 
-       if (set_swap_if_low_ram(&install) < 0)
-               return;
+       set_swap_if_low_ram(&install);
 
        if (md_pre_update(&install) < 0)
                goto free_install;



Home | Main Index | Thread Index | Old Index