diff options
-rw-r--r-- | lib/libdisk/Makefile | 1 | ||||
-rw-r--r-- | lib/libdisk/chunk.c | 2 | ||||
-rw-r--r-- | lib/libdisk/write_alpha_disk.c | 12 | ||||
-rw-r--r-- | lib/libdisk/write_amd64_disk.c | 11 | ||||
-rw-r--r-- | lib/libdisk/write_i386_disk.c | 11 | ||||
-rw-r--r-- | lib/libdisk/write_ia64_disk.c | 11 | ||||
-rw-r--r-- | lib/libdisk/write_pc98_disk.c | 10 |
7 files changed, 3 insertions, 55 deletions
diff --git a/lib/libdisk/Makefile b/lib/libdisk/Makefile index ec637d1..0ea14ba 100644 --- a/lib/libdisk/Makefile +++ b/lib/libdisk/Makefile @@ -4,6 +4,7 @@ LIB= disk SRCS= blocks.c chunk.c disk.c change.c \ create_chunk.c rules.c write_disk.c INCS= libdisk.h + WARNS= 2 .if ${MACHINE} == "pc98" diff --git a/lib/libdisk/chunk.c b/lib/libdisk/chunk.c index 2b4854d..cf93722 100644 --- a/lib/libdisk/chunk.c +++ b/lib/libdisk/chunk.c @@ -362,7 +362,7 @@ Delete_Chunk2(struct disk *d, struct chunk *c, int rflags) { struct chunk *c1=0, *c2, *c3; chunk_e type = c->type; - long offset = c->offset; + u_long offset = c->offset; if(type == whole) return 1; diff --git a/lib/libdisk/write_alpha_disk.c b/lib/libdisk/write_alpha_disk.c index 313aae4..0e902f0 100644 --- a/lib/libdisk/write_alpha_disk.c +++ b/lib/libdisk/write_alpha_disk.c @@ -73,7 +73,7 @@ Write_FreeBSD(int fd, const struct disk *new, const struct disk *old, const stru int Write_Disk(const struct disk *d1) { - int fd,i; + int fd; struct disk *old = 0; struct chunk *c1; int ret = 0; @@ -81,8 +81,6 @@ Write_Disk(const struct disk *d1) u_char *mbr; struct dos_partition *dp,work[NDOSPART]; int s[4]; - int one = 1; - int zero = 0; strcpy(device,_PATH_DEV); strcat(device,d1->name); @@ -95,7 +93,6 @@ Write_Disk(const struct disk *d1) #endif return 1; } - ioctl(fd, DIOCWLABEL, &one); memset(s,0,sizeof s); mbr = read_block(fd, 0, d1->sector_size); @@ -111,13 +108,6 @@ Write_Disk(const struct disk *d1) } - i = 1; - i = ioctl(fd, DIOCSYNCSLICEINFO, &i); -#ifdef DEBUG - if (i != 0) - warn("ioctl(DIOCSYNCSLICEINFO)"); -#endif - ioctl(fd, DIOCWLABEL, &zero); close(fd); return 0; } diff --git a/lib/libdisk/write_amd64_disk.c b/lib/libdisk/write_amd64_disk.c index 686758e..ad788a2 100644 --- a/lib/libdisk/write_amd64_disk.c +++ b/lib/libdisk/write_amd64_disk.c @@ -17,7 +17,6 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <sys/types.h> #include <sys/stat.h> -#include <sys/ioctl.h> #include <sys/disklabel.h> #include <sys/diskslice.h> #include <sys/diskmbr.h> @@ -93,8 +92,6 @@ Write_Disk(const struct disk *d1) struct dos_partition *dp,work[NDOSPART]; int s[4]; int need_edd = 0; /* Need EDD (packet interface) */ - int one = 1; - int zero = 0; strcpy(device,_PATH_DEV); strcat(device,d1->name); @@ -107,7 +104,6 @@ Write_Disk(const struct disk *d1) #endif return 1; } - ioctl(fd, DIOCWLABEL, &one); memset(s,0,sizeof s); mbr = read_block(fd, 0, d1->sector_size); @@ -200,13 +196,6 @@ Write_Disk(const struct disk *d1) for(i = 1; i * d1->sector_size <= d1->bootmgr_size; i++) write_block(fd, i, &d1->bootmgr[i * d1->sector_size], d1->sector_size); - i = 1; - i = ioctl(fd, DIOCSYNCSLICEINFO, &i); -#ifdef DEBUG - if (i != 0) - warn("ioctl(DIOCSYNCSLICEINFO)"); -#endif - ioctl(fd, DIOCWLABEL, &zero); close(fd); return 0; } diff --git a/lib/libdisk/write_i386_disk.c b/lib/libdisk/write_i386_disk.c index 686758e..ad788a2 100644 --- a/lib/libdisk/write_i386_disk.c +++ b/lib/libdisk/write_i386_disk.c @@ -17,7 +17,6 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <sys/types.h> #include <sys/stat.h> -#include <sys/ioctl.h> #include <sys/disklabel.h> #include <sys/diskslice.h> #include <sys/diskmbr.h> @@ -93,8 +92,6 @@ Write_Disk(const struct disk *d1) struct dos_partition *dp,work[NDOSPART]; int s[4]; int need_edd = 0; /* Need EDD (packet interface) */ - int one = 1; - int zero = 0; strcpy(device,_PATH_DEV); strcat(device,d1->name); @@ -107,7 +104,6 @@ Write_Disk(const struct disk *d1) #endif return 1; } - ioctl(fd, DIOCWLABEL, &one); memset(s,0,sizeof s); mbr = read_block(fd, 0, d1->sector_size); @@ -200,13 +196,6 @@ Write_Disk(const struct disk *d1) for(i = 1; i * d1->sector_size <= d1->bootmgr_size; i++) write_block(fd, i, &d1->bootmgr[i * d1->sector_size], d1->sector_size); - i = 1; - i = ioctl(fd, DIOCSYNCSLICEINFO, &i); -#ifdef DEBUG - if (i != 0) - warn("ioctl(DIOCSYNCSLICEINFO)"); -#endif - ioctl(fd, DIOCWLABEL, &zero); close(fd); return 0; } diff --git a/lib/libdisk/write_ia64_disk.c b/lib/libdisk/write_ia64_disk.c index 686758e..ad788a2 100644 --- a/lib/libdisk/write_ia64_disk.c +++ b/lib/libdisk/write_ia64_disk.c @@ -17,7 +17,6 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <sys/types.h> #include <sys/stat.h> -#include <sys/ioctl.h> #include <sys/disklabel.h> #include <sys/diskslice.h> #include <sys/diskmbr.h> @@ -93,8 +92,6 @@ Write_Disk(const struct disk *d1) struct dos_partition *dp,work[NDOSPART]; int s[4]; int need_edd = 0; /* Need EDD (packet interface) */ - int one = 1; - int zero = 0; strcpy(device,_PATH_DEV); strcat(device,d1->name); @@ -107,7 +104,6 @@ Write_Disk(const struct disk *d1) #endif return 1; } - ioctl(fd, DIOCWLABEL, &one); memset(s,0,sizeof s); mbr = read_block(fd, 0, d1->sector_size); @@ -200,13 +196,6 @@ Write_Disk(const struct disk *d1) for(i = 1; i * d1->sector_size <= d1->bootmgr_size; i++) write_block(fd, i, &d1->bootmgr[i * d1->sector_size], d1->sector_size); - i = 1; - i = ioctl(fd, DIOCSYNCSLICEINFO, &i); -#ifdef DEBUG - if (i != 0) - warn("ioctl(DIOCSYNCSLICEINFO)"); -#endif - ioctl(fd, DIOCWLABEL, &zero); close(fd); return 0; } diff --git a/lib/libdisk/write_pc98_disk.c b/lib/libdisk/write_pc98_disk.c index 7d4f33e..c6dc816 100644 --- a/lib/libdisk/write_pc98_disk.c +++ b/lib/libdisk/write_pc98_disk.c @@ -71,8 +71,6 @@ Write_Disk(const struct disk *d1) struct dos_partition *dp,work[NDOSPART]; int s[7]; int PC98_EntireDisk = 0; - int one = 1; - int zero = 0; strcpy(device,_PATH_DEV); strcat(device,d1->name); @@ -90,7 +88,6 @@ Write_Disk(const struct disk *d1) #endif return 1; } - ioctl(fd, DIOCWLABEL, &one); memset(s,0,sizeof s); mbr = read_block(fd, 1, d1->sector_size); @@ -173,13 +170,6 @@ Write_Disk(const struct disk *d1) for (i = 0; i * d1->sector_size < d1->bootmenu_size; i++) write_block(fd, 2 + i, &d1->bootmenu[i * d1->sector_size], d1->sector_size); - i = 1; - i = ioctl(fd, DIOCSYNCSLICEINFO, &i); -#ifdef DEBUG - if (i != 0) - warn("ioctl(DIOCSYNCSLICEINFO)"); -#endif - ioctl(fd, DIOCWLABEL, &zero); close(fd); return 0; } |