diff options
author | jkh <jkh@FreeBSD.org> | 1996-04-29 05:03:02 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-04-29 05:03:02 +0000 |
commit | b431239bb3be5c214ce52625c63686706e1f7c80 (patch) | |
tree | 9e00edae9b557a40ed455a869750b34be9d1b3eb /lib | |
parent | 9059910165e6899031d64bb8af99775f82d4cf5e (diff) | |
download | FreeBSD-src-b431239bb3be5c214ce52625c63686706e1f7c80.zip FreeBSD-src-b431239bb3be5c214ce52625c63686706e1f7c80.tar.gz |
Move some warn()'s into DEBUG space since I don't need them coming
out in my curses interfaces and spamming my screen.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libdisk/create_chunk.c | 7 | ||||
-rw-r--r-- | lib/libdisk/disk.c | 30 | ||||
-rw-r--r-- | 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 05a22a2..32d8012 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 911eece..5f2e695 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;i<ds.dss_nslices;i++) { char sname[20]; @@ -141,9 +149,13 @@ Int_Open_Disk(const char *name, u_long size) ce = unknown; break; } - if (Add_Chunk(d,ds.dss_slices[i].ds_offset, - ds.dss_slices[i].ds_size, sname,ce,subtype,flags)) - warn("failed to add chunk for slice %d",i - 1); + if (Add_Chunk(d, ds.dss_slices[i].ds_offset, + ds.dss_slices[i].ds_size, sname, ce, subtype, flags)) +#ifdef DEBUG + warn("failed to add chunk for slice %d", i - 1); +#else + {} +#endif if (ds.dss_slices[i].ds_type != 0xa5) continue; @@ -156,12 +168,16 @@ Int_Open_Disk(const char *name, u_long size) strcat(pname,sname); j = open(pname,O_RDONLY); if (j < 0) { +#ifdef DEBUG warn("open(%s)",pname); +#endif continue; } k = ioctl(j,DIOCGDINFO,&dl); if (k < 0) { +#ifdef DEBUG warn("ioctl(%s,DIOCGDINFO)",pname); +#endif close(j); continue; } @@ -190,10 +206,14 @@ Int_Open_Disk(const char *name, u_long size) pname,part, dl.d_partitions[j].p_fstype, 0) && j != 3) +#ifdef DEBUG warn( "Failed to add chunk for partition %c [%lu,%lu]", j + 'a',dl.d_partitions[j].p_offset, dl.d_partitions[j].p_size); +#else + {} +#endif } } } diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c index 00b2946..dceab4d 100644 --- a/lib/libdisk/write_disk.c +++ b/lib/libdisk/write_disk.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: write_disk.c,v 1.15 1995/08/26 04:57:03 davidg Exp $ + * $Id: write_disk.c,v 1.16 1995/12/07 10:33:27 peter Exp $ * */ @@ -58,7 +58,9 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1) if (!strcmp(c2->name,"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; } |