Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sbin/fdisk Pullup rev 1.81 (requested by dbj in ticket ...



details:   https://anonhg.NetBSD.org/src/rev/633515f707a0
branches:  netbsd-2-0
changeset: 562408:633515f707a0
user:      jmc <jmc%NetBSD.org@localhost>
date:      Mon Aug 16 17:46:13 2004 +0000

description:
Pullup rev 1.81 (requested by dbj in ticket #767)

Add support to pxeboot for reading the bios disk geometry
as well as fixing several related bugs that occur when the bios
geometry is not read by the boot loader.

diffstat:

 sbin/fdisk/fdisk.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r cb0242deebdf -r 633515f707a0 sbin/fdisk/fdisk.c
--- a/sbin/fdisk/fdisk.c        Mon Aug 16 17:46:09 2004 +0000
+++ b/sbin/fdisk/fdisk.c        Mon Aug 16 17:46:13 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fdisk.c,v 1.77 2004/03/24 02:49:37 lukem Exp $ */
+/*     $NetBSD: fdisk.c,v 1.77.2.1 2004/08/16 17:46:13 jmc Exp $ */
 
 /*
  * Mach Operating System
@@ -35,7 +35,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.77 2004/03/24 02:49:37 lukem Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.77.2.1 2004/08/16 17:46:13 jmc Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -1012,11 +1012,14 @@
        mib[0] = CTL_MACHDEP;
        mib[1] = CPU_DISKINFO;
        if (sysctl(mib, 2, NULL, &len, NULL, 0) < 0) {
-               intuit_translated_geometry();
-               return;
+               goto out;
        }
        dl = (struct disklist *) malloc(len);
-       sysctl(mib, 2, dl, &len, NULL, 0);
+       if (sysctl(mib, 2, dl, &len, NULL, 0) < 0) {
+               free(dl);
+               dl = 0;
+               goto out;
+       }
 
        get_diskname(disk, diskname, sizeof diskname);
 
@@ -1040,6 +1043,7 @@
                        return;
                }
        }
+ out:
        /* Allright, allright, make a stupid guess.. */
        intuit_translated_geometry();
 }



Home | Main Index | Thread Index | Old Index