diff options
author | obrien <obrien@FreeBSD.org> | 2001-03-18 21:30:11 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-03-18 21:30:11 +0000 |
commit | 981727ddcf88331bb90ab6e04eb90eb45c5f5314 (patch) | |
tree | 6f19e1a756fa276db4c8bf3e3a32f6cdd5215541 /lib/libdisk/chunk.c | |
parent | 68ae8502935dde5a352a4351e99bb281e64be0b5 (diff) | |
download | FreeBSD-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/chunk.c')
-rw-r--r-- | lib/libdisk/chunk.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/libdisk/chunk.c b/lib/libdisk/chunk.c index 424382a..a8f3b96 100644 --- a/lib/libdisk/chunk.c +++ b/lib/libdisk/chunk.c @@ -15,7 +15,6 @@ #include <unistd.h> #include <string.h> #include <sys/types.h> -#include <err.h> #include "libdisk.h" #define new_chunk() memset(malloc(sizeof(struct chunk)), 0, sizeof(struct chunk)) @@ -97,7 +96,7 @@ Clone_Chunk(struct chunk *c1) if(!c1) return 0; c2 = new_chunk(); - if (!c2) err(1,"malloc failed"); + if (!c2) barfout(1,"malloc failed"); *c2 = *c1; if (c1->private_data && c1->private_clone) c2->private_data = c2->private_clone(c2->private_data); @@ -126,7 +125,7 @@ Insert_Chunk(struct chunk *c2, u_long offset, u_long size, const char *name, return __LINE__; ct = new_chunk(); - if (!ct) err(1,"malloc failed"); + if (!ct) barfout(1,"malloc failed"); memset(ct,0,sizeof *ct); ct->disk = c2->disk; ct->offset = offset; @@ -147,7 +146,7 @@ Insert_Chunk(struct chunk *c2, u_long offset, u_long size, const char *name, if(type==freebsd || type==extended) { cs = new_chunk(); - if (!cs) err(1,"malloc failed"); + if (!cs) barfout(1,"malloc failed"); memset(cs,0,sizeof *cs); cs->disk = c2->disk; cs->offset = offset; @@ -164,7 +163,7 @@ Insert_Chunk(struct chunk *c2, u_long offset, u_long size, const char *name, /* Make a new chunk for any trailing unused space */ if (c2->end > ct->end) { cs = new_chunk(); - if (!cs) err(1,"malloc failed"); + if (!cs) barfout(1,"malloc failed"); *cs = *c2; cs->disk = c2->disk; cs->offset = ct->end + 1; @@ -222,10 +221,10 @@ Add_Chunk(struct disk *d, long offset, u_long size, const char *name, if (type == whole) { d->chunks = c1 = new_chunk(); - if (!c1) err(1,"malloc failed"); + if (!c1) barfout(1,"malloc failed"); memset(c1,0,sizeof *c1); c2 = c1->part = new_chunk(); - if (!c2) err(1,"malloc failed"); + if (!c2) barfout(1,"malloc failed"); memset(c2,0,sizeof *c2); c2->disk = c1->disk = d; c2->offset = c1->offset = offset; @@ -448,7 +447,7 @@ Collapse_Chunk(struct disk *d, struct chunk *c1) } if(c3->type == unused) { c2 = new_chunk(); - if (!c2) err(1,"malloc failed"); + if (!c2) barfout(1,"malloc failed"); *c2 = *c1; c1->next = c2; c1->disk = d; |