From 0ffc27529d2c7ca6ee9effc3d7b9992202957586 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 30 Apr 1995 22:51:05 +0000 Subject: Use the DIOCSYNCSLICE ioctl now. (use only with kernel from this morning). Get the CHS's right. Get the disklabels (more) right. --- release/libdisk/disk.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'release/libdisk/disk.c') diff --git a/release/libdisk/disk.c b/release/libdisk/disk.c index f421224..b9363a0 100644 --- a/release/libdisk/disk.c +++ b/release/libdisk/disk.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: disk.c,v 1.7 1995/04/30 07:30:43 phk Exp $ + * $Id: disk.c,v 1.8 1995/04/30 11:04:13 phk Exp $ * */ @@ -99,10 +99,6 @@ Int_Open_Disk(char *name, u_long size) if (Add_Chunk(d, 0, size, name,whole,0,0)) warn("Failed to add 'whole' chunk"); - if (ds.dss_slices[COMPATIBILITY_SLICE].ds_offset) - if (Add_Chunk(d, 0, 1, "-",reserved,0,0)) - warn("Failed to add MBR chunk"); - for(i=BASE_SLICE;ibootmgr) free(d->bootmgr); - d->bootmgr = malloc(DOSPARTOFF); - if(!d->bootmgr) err(1,"malloc failed"); - memcpy(d->bootmgr,b,DOSPARTOFF); + if (!b) { + d->bootmgr = 0; + } else { + d->bootmgr = malloc(DOSPARTOFF); + if(!d->bootmgr) err(1,"malloc failed"); + memcpy(d->bootmgr,b,DOSPARTOFF); + } } void -- cgit v1.1