summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/create_chunk.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-03-18 21:30:11 +0000
committerobrien <obrien@FreeBSD.org>2001-03-18 21:30:11 +0000
commit981727ddcf88331bb90ab6e04eb90eb45c5f5314 (patch)
tree6f19e1a756fa276db4c8bf3e3a32f6cdd5215541 /lib/libdisk/create_chunk.c
parent68ae8502935dde5a352a4351e99bb281e64be0b5 (diff)
downloadFreeBSD-src-981727ddcf88331bb90ab6e04eb90eb45c5f5314.zip
FreeBSD-src-981727ddcf88331bb90ab6e04eb90eb45c5f5314.tar.gz
Libraries should _never_ call exit() themselves (or its alternate spelling
`err()'). libdisk does! and additionally libdisk gets confused on Alpha disks with foreign disklabels, throws up its hands and exits. This is the cause of the "going no where without my init" install bug on the Alpha. So now on the Alpha, rather than call err(), we print the error string and continue processing. Submitted by: jkh
Diffstat (limited to 'lib/libdisk/create_chunk.c')
-rw-r--r--lib/libdisk/create_chunk.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index 0a9984d..3f84619 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -22,7 +22,6 @@
#include <sys/diskslice.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <err.h>
#include <grp.h>
#include <paths.h>
#include <pwd.h>
@@ -69,7 +68,7 @@ Fixup_FreeBSD_Names(struct disk *d, struct chunk *c)
for (c1 = c->part; c1 ; c1 = c1->next) {
c1->oname = c1->name;
c1->name = malloc(12);
- if(!c1->name) err(1,"Malloc failed");
+ if(!c1->name) barfout(1,"Malloc failed");
strcpy(c1->name,"X");
}
@@ -134,7 +133,7 @@ Fixup_Extended_Names(struct disk *d, struct chunk *c)
if (c1->type == unused) continue;
free(c1->name);
c1->name = malloc(12);
- if(!c1->name) err(1,"malloc failed");
+ if(!c1->name) barfout(1,"malloc failed");
sprintf(c1->name,"%ss%d",d->chunks->name,j++);
if (c1->type == freebsd)
Fixup_FreeBSD_Names(d,c1);
@@ -156,7 +155,7 @@ Fixup_Names(struct disk *d)
continue;
#ifndef __alpha__
c2->oname = malloc(12);
- if(!c2->oname) err(1,"malloc failed");
+ if(!c2->oname) barfout(1,"malloc failed");
for(j=1;j<=NDOSPART;j++) {
sprintf(c2->oname,"%ss%d",c1->name,j);
for(c3 = c1->part; c3 ; c3 = c3->next)
@@ -260,7 +259,7 @@ Create_Chunk_DWIM(struct disk *d, struct chunk *parent , u_long size, chunk_e ty
for (c1=parent->part; c1 ; c1 = c1->next)
if (c1->offset == offset)
return c1;
- err(1,"Serious internal trouble");
+ barfout(1,"Serious internal trouble");
}
int
OpenPOWER on IntegriCloud