From d402093152f568e53edac91e4b8534d846d37f43 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Mon, 29 Apr 1996 05:03:02 +0000 Subject: [PATCH] Move some warn()'s into DEBUG space since I don't need them coming out in my curses interfaces and spamming my screen. --- lib/libdisk/create_chunk.c | 7 ++----- lib/libdisk/disk.c | 30 +++++++++++++++++++++++++----- lib/libdisk/write_disk.c | 8 +++++++- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c index 05a22a26ad68..32d8012c4a69 100644 --- a/lib/libdisk/create_chunk.c +++ b/lib/libdisk/create_chunk.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: create_chunk.c,v 1.22 1995/12/07 10:33:20 peter Exp $ + * $Id: create_chunk.c,v 1.23 1996/03/24 18:55:37 joerg Exp $ * */ @@ -221,7 +221,6 @@ Create_Chunk_DWIM(struct disk *d, struct chunk *parent , u_long size, chunk_e ty offset = c1->offset; goto found; } - warn("Not enough unused space"); return 0; found: if (parent->flags & CHUNK_BAD144) { @@ -232,10 +231,8 @@ Create_Chunk_DWIM(struct disk *d, struct chunk *parent , u_long size, chunk_e ty size = edge - offset + 1; } i = Add_Chunk(d,offset,size,"X",type,subtype,flags); - if (i) { - warn("Didn't cut it"); + if (i) return 0; - } Fixup_Names(d); for (c1=parent->part; c1 ; c1 = c1->next) if (c1->offset == offset) diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c index 911eecef85cd..5f2e6951427f 100644 --- a/lib/libdisk/disk.c +++ b/lib/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.20 1995/06/11 19:29:34 rgrimes Exp $ + * $Id: disk.c,v 1.21 1996/03/24 18:55:37 joerg Exp $ * */ @@ -64,7 +64,9 @@ Int_Open_Disk(const char *name, u_long size) fd = open(device,O_RDONLY); if (fd < 0) { +#ifdef DEBUG warn("open(%s) failed",device); +#endif return 0; } @@ -72,7 +74,9 @@ Int_Open_Disk(const char *name, u_long size) ioctl(fd,DIOCGDINFO,&dl); i = ioctl(fd,DIOCGSLICEINFO,&ds); if (i < 0) { +#ifdef DEBUG warn("DIOCGSLICEINFO(%s) failed",device); +#endif close(fd); return 0; } @@ -112,8 +116,12 @@ Int_Open_Disk(const char *name, u_long size) if (dl.d_ntracks && dl.d_nsectors) d->bios_cyl = size/(dl.d_ntracks*dl.d_nsectors); - if (Add_Chunk(d, -offset, size, name,whole,0,0)) + if (Add_Chunk(d, -offset, size, name, whole, 0, 0)) +#ifdef DEBUG warn("Failed to add 'whole' chunk"); +#else + {} +#endif for(i=BASE_SLICE;iname,"X")) continue; j = c2->name[5] - 'a'; if (j < 0 || j >= MAXPARTITIONS || j == RAW_PART) { +#ifdef DEBUG warn("Weird parititon letter %c",c2->name[5]); +#endif continue; } dl->d_partitions[j].p_size = c2->size; @@ -133,7 +135,9 @@ Write_Disk(struct disk *d1) fd = open(device,O_RDWR); if (fd < 0) { +#ifdef DEBUG warn("open(%s) failed",device); +#endif return 1; } @@ -225,8 +229,10 @@ Write_Disk(struct disk *d1) i = 1; i = ioctl(fd,DIOCSYNCSLICEINFO,&i); +#ifdef DEBUG if (i != 0) warn("ioctl(DIOCSYNCSLICEINFO)"); +#endif close(fd); return 0; }