Sprinkle a load of consts, and change a few variable names.

Now compiles with WARNS=3.
This commit is contained in:
dsl 2003-07-25 08:26:21 +00:00
parent 5cd6e49033
commit 7f5beafa6b
66 changed files with 319 additions and 323 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.25 2003/07/10 10:34:16 lukem Exp $
# $NetBSD: Makefile.inc,v 1.26 2003/07/25 08:26:21 dsl Exp $
#
# Makefile for sysinst
@ -53,7 +53,7 @@ CPPFLAGS+= -DSYSINST_CDROM_DIR=\"${SYSINST_CDROM_DIR}\"
.endif
WARNS= 1
WARNS= 3
CLEANFILES= menu_defs.c menu_defs.h menus.def \
msg_defs.c msg_defs.h msg.def msgtouch \

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.12 2003/07/11 15:29:00 dsl Exp $ */
/* $NetBSD: md.c,v 1.13 2003/07/25 08:26:23 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -133,7 +133,7 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
static char bb[DEV_BSIZE];
struct filecore_bootblock *fcbb = (struct filecore_bootblock *)bb;
int offset = 0;
@ -143,17 +143,17 @@ md_get_info(void)
else
disktype = "SCSI";
snprintf(devname, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
snprintf(dev_name, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.7 2003/06/14 12:58:46 dsl Exp $ */
/* $NetBSD: md.h,v 1.8 2003/07/25 08:26:23 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -73,7 +73,7 @@
* Default fileystem type for floppy disks.
* On acorn26, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*
* prototypes for MD code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.13 2003/07/11 15:29:01 dsl Exp $ */
/* $NetBSD: md.c,v 1.14 2003/07/25 08:26:23 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -132,7 +132,7 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
static char bb[DEV_BSIZE];
struct filecore_bootblock *fcbb = (struct filecore_bootblock *)bb;
int offset = 0;
@ -142,17 +142,17 @@ md_get_info(void)
else
disktype = "SCSI";
snprintf(devname, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
snprintf(dev_name, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.10 2003/06/14 12:58:46 dsl Exp $ */
/* $NetBSD: md.h,v 1.11 2003/07/25 08:26:24 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -75,7 +75,7 @@
* Default fileystem type for floppy disks.
* On acorn32, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*
* prototypes for MD code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.34 2003/06/13 11:57:30 dsl Exp $ */
/* $NetBSD: md.c,v 1.35 2003/07/25 08:26:24 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -66,19 +66,19 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf (devname, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
snprintf (dev_name, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
fd = open (devname, O_RDONLY, 0);
fd = open (dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf (stderr, "Can't open %s\n", devname);
fprintf (stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf (stderr, "Can't read disklabel on %s.\n", devname);
fprintf (stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.14 2003/06/11 21:35:37 dsl Exp $ */
/* $NetBSD: md.h,v 1.15 2003/07/25 08:26:24 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -63,4 +63,4 @@
/*
* Default file system type for floppies.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.10 2003/06/14 12:58:47 dsl Exp $ */
/* $NetBSD: md.h,v 1.11 2003/07/25 08:26:24 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -73,7 +73,7 @@
#define SET_MD_1_NAME "toolchain"
/* Bootblock type */
EXTERN char *boottype INIT("");
EXTERN const char *boottype INIT("");
/*
* Machine-specific command to write a new label to a disk.
@ -93,7 +93,7 @@ EXTERN char *boottype INIT("");
* Default fileystem type for floppy disks.
* On x86_64, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
#define _PATH_MBR DEFAULT_BOOTDIR "/" DEFAULT_BOOTCODE
#define _PATH_BOOTSEL DEFAULT_BOOTDIR "/" DEFAULT_BOOTSELCODE

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.10 2003/06/13 22:27:05 dsl Exp $ */
/* $NetBSD: md.h,v 1.11 2003/07/25 08:26:24 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -87,7 +87,7 @@
* Default fileystem type for floppy disks.
* On amiga, that is ados.
*/
EXTERN char *fdtype INIT("ados");
EXTERN const char *fdtype INIT("ados");
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.7 2003/06/13 22:27:05 dsl Exp $ */
/* $NetBSD: md.h,v 1.8 2003/07/25 08:26:25 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -79,7 +79,7 @@
* Default fileystem type for floppy disks.
* On arc, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.11 2003/06/14 12:58:47 dsl Exp $ */
/* $NetBSD: md.h,v 1.12 2003/07/25 08:26:25 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -86,7 +86,7 @@
* Default fileystem type for floppy disks.
* On atari, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.10 2003/06/11 21:35:39 dsl Exp $ */
/* $NetBSD: md.h,v 1.11 2003/07/25 08:26:25 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -76,7 +76,7 @@
* Default fileystem type for floppy disks.
* On bebox, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.11 2003/07/11 15:29:02 dsl Exp $ */
/* $NetBSD: md.c,v 1.12 2003/07/25 08:26:26 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -59,7 +59,7 @@ md_get_info (void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
#if 0
static char bb[DEV_BSIZE];
struct filecore_bootblock *fcbb = (struct filecore_bootblock *)bb;
@ -71,17 +71,17 @@ md_get_info (void)
else
disktype = "SCSI";
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.7 2003/06/14 12:58:48 dsl Exp $ */
/* $NetBSD: md.h,v 1.8 2003/07/25 08:26:26 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -67,7 +67,7 @@
* Default fileystem type for floppy disks.
* On cats, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*
* prototypes for MD code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.12 2003/07/11 15:29:02 dsl Exp $ */
/* $NetBSD: md.c,v 1.13 2003/07/25 08:26:26 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -58,24 +58,24 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
if (strncmp(diskdev, "wd", 2) == 0)
disktype = "ST506";
else
disktype = "SCSI";
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.8 2003/06/14 12:58:48 dsl Exp $ */
/* $NetBSD: md.h,v 1.9 2003/07/25 08:26:26 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -72,7 +72,7 @@
* Default fileystem type for floppy disks.
* On evbarm, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*
* prototypes for MD code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.5 2003/06/11 21:35:41 dsl Exp $ */
/* $NetBSD: md.h,v 1.6 2003/07/25 08:26:26 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -75,7 +75,7 @@
* Default fileystem type for floppy disks.
* On bebox, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.10 2003/06/16 10:42:48 dsl Exp $ */
/* $NetBSD: md.c,v 1.11 2003/07/25 08:26:27 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -57,25 +57,25 @@ md_get_info(void)
{
char buf[1024];
int fd;
char devname[100];
char dev_name[100];
struct disklabel disklabel;
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
if (logging)
(void)fprintf(logfp, "Can't open %s\n", devname);
(void)fprintf(logfp, "Can't open %s\n", dev_name);
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
if (logging)
(void)fprintf(logfp, "Can't read disklabel on %s.\n",
devname);
dev_name);
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}
@ -95,7 +95,7 @@ md_get_info(void)
if (read(fd, buf, 1024) < 0) {
endwin();
fprintf(stderr, "Can't read %s\n", devname);
fprintf(stderr, "Can't read %s\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.6 2003/06/13 11:57:31 dsl Exp $ */
/* $NetBSD: md.h,v 1.7 2003/07/25 08:26:27 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -100,4 +100,4 @@
* Default fileystem type for floppy disks.
* On hp300, if we had floppies, that would be ffs.
*/
EXTERN char *fdtype INIT("ffs");
EXTERN const char *fdtype INIT("ffs");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.20 2003/06/13 22:27:07 dsl Exp $ */
/* $NetBSD: md.h,v 1.21 2003/07/25 08:26:27 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -82,7 +82,7 @@
* Default fileystem type for floppy disks.
* On i386, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*
* prototypes for MD code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.92 2003/07/10 13:36:50 dsl Exp $ */
/* $NetBSD: md.c,v 1.93 2003/07/25 08:26:27 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -67,7 +67,7 @@ static struct biosdisk_info *biosdisk = NULL;
static int mbr_root_above_chs(void);
static void md_upgrade_mbrtype(void);
static int md_read_bootcode(const char *path, mbr_sector_t *mbr);
static int md_read_bootcode(const char *, mbr_sector_t *);
#if defined(__i386__)
static unsigned int get_bootmodel(void);
#endif
@ -209,7 +209,7 @@ edit:
* The existing partition table and bootselect configuration is kept.
*/
static int
md_read_bootcode(const char *path, mbr_sector_t *mbr)
md_read_bootcode(const char *path, mbr_sector_t *mbrs)
{
int fd;
struct stat st;
@ -220,7 +220,7 @@ md_read_bootcode(const char *path, mbr_sector_t *mbr)
if (fd < 0)
return -1;
if (fstat(fd, &st) < 0 || st.st_size != sizeof *mbr) {
if (fstat(fd, &st) < 0 || st.st_size != sizeof *mbrs) {
close(fd);
return -1;
}
@ -234,21 +234,21 @@ md_read_bootcode(const char *path, mbr_sector_t *mbr)
if (new_mbr.mbr_bootsel.mbrb_magic != htole16(MBR_MAGIC))
return -1;
if (mbr->mbr_bootsel.mbrb_magic == htole16(MBR_MAGIC)) {
if (mbrs->mbr_bootsel.mbrb_magic == htole16(MBR_MAGIC)) {
len = offsetof(mbr_sector_t, mbr_bootsel);
if (!(mbr->mbr_bootsel.mbrb_flags & BFL_NEWMBR))
if (!(mbrs->mbr_bootsel.mbrb_flags & BFL_NEWMBR))
/*
* Meaning of keys has changed, force a sensible
* default (old code didn't preseve the answer).
*/
mbr->mbr_bootsel.mbrb_defkey = SCAN_ENTER;
mbrs->mbr_bootsel.mbrb_defkey = SCAN_ENTER;
} else
len = offsetof(mbr_sector_t, mbr_parts);
memcpy(mbr, &new_mbr, len);
memcpy(mbrs, &new_mbr, len);
/* Keep flags from object file - indicate the properties */
mbr->mbr_bootsel.mbrb_flags = new_mbr.mbr_bootsel.mbrb_flags;
mbr->mbr_signature = htole16(MBR_MAGIC);
mbrs->mbr_bootsel.mbrb_flags = new_mbr.mbr_bootsel.mbrb_flags;
mbrs->mbr_signature = htole16(MBR_MAGIC);
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.45 2003/07/07 12:30:25 dsl Exp $ */
/* $NetBSD: md.h,v 1.46 2003/07/25 08:26:27 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -85,7 +85,7 @@
#define DISK_NAMES "wd", "sd", "ld", "ed"
/* Bootblock type */
EXTERN char *boottype INIT("");
EXTERN const char *boottype INIT("");
/*
* Machine-specific command to write a new label to a disk.
@ -105,7 +105,7 @@ EXTERN char *boottype INIT("");
* Default fileystem type for floppy disks.
* On i386, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
#define _PATH_MBR DEFAULT_BOOTDIR "/" DEFAULT_BOOTCODE
#define _PATH_BOOTSEL DEFAULT_BOOTDIR "/" DEFAULT_BOOTSELCODE

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.37 2003/07/11 15:29:03 dsl Exp $ */
/* $NetBSD: md.c,v 1.38 2003/07/25 08:26:28 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -238,7 +238,7 @@ getName(part, len_name, name)
EBZB *bzb;
int fd;
off_t seek;
char devname[100], macosblk[512];
char dev_name[100], macosblk[512];
*name = '\0';
bzb = (EBZB *)&part->pmBootArgs[0];
@ -254,11 +254,11 @@ getName(part, len_name, name)
/*
* OK, this is stupid but it's damn nice to know!
*/
snprintf (devname, sizeof(devname), "/dev/r%sc", diskdev);
snprintf (dev_name, sizeof(dev_name), "/dev/r%sc", diskdev);
/*
* Open the disk as a raw device
*/
if ((fd = open(devname, O_RDONLY, 0)) >= 0) {
if ((fd = open(dev_name, O_RDONLY, 0)) >= 0) {
seek = (off_t)part->pmPyPartStart + (off_t)2;
seek *= (off_t)blk_size;
lseek(fd, seek, SEEK_SET);
@ -653,19 +653,19 @@ md_get_info()
{
struct disklabel disklabel;
int fd, i;
char devname[100];
char dev_name[100];
struct apple_part_map_entry block;
snprintf(devname, sizeof(devname), "/dev/r%s%c",
snprintf(dev_name, sizeof(dev_name), "/dev/r%s%c",
diskdev, 'a' + getrawpartition());
/*
* Open the disk as a raw device
*/
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf (stderr, "Can't open %s\n", devname);
fprintf (stderr, "Can't open %s\n", dev_name);
exit(1);
}
/*
@ -673,7 +673,7 @@ md_get_info()
*/
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf (stderr, "Can't read disklabel on %s\n", devname);
fprintf (stderr, "Can't read disklabel on %s\n", dev_name);
close(fd);
exit(1);
}
@ -753,7 +753,7 @@ int
md_pre_disklabel()
{
int fd;
char devname[100];
char dev_name[100];
struct disklabel lp;
Block0 new_block0 = {APPLE_DRVR_MAP_MAGIC, 512, 0};
@ -763,13 +763,13 @@ md_pre_disklabel()
*/
printf ("%s", msg_string (MSG_dodiskmap));
snprintf (devname, sizeof(devname), "/dev/r%sc", diskdev);
snprintf (dev_name, sizeof(dev_name), "/dev/r%sc", diskdev);
/*
* Open the disk as a raw device
*/
if ((fd = open(devname, O_WRONLY, 0)) < 0) {
if ((fd = open(dev_name, O_WRONLY, 0)) < 0) {
endwin();
fprintf(stderr, "Can't open %s to rewrite the Disk Map\n", devname);
fprintf(stderr, "Can't open %s to rewrite the Disk Map\n", dev_name);
exit (1);
}
/*
@ -840,17 +840,17 @@ md_post_disklabel(void)
{
struct disklabel updated_label;
int fd, i, no_match;
char devname[100], buf[80];
char *fst[] = {"free", "swap", " v6 ", " v7 ", "sysv", "v71k",
" v8 ", "ffs ", "dos ", "lfs ", "othr", "hpfs",
"9660", "boot", "ados", "hfs ", "fcor", "ex2f",
"ntfs", "raid", "ccd "};
snprintf(devname, sizeof(devname), "/dev/r%sc", diskdev);
char dev_name[100], buf[80];
const char *fst[] = {"free", "swap", " v6 ", " v7 ", "sysv", "v71k",
" v8 ", "ffs ", "dos ", "lfs ", "othr", "hpfs",
"9660", "boot", "ados", "hfs ", "fcor", "ex2f",
"ntfs", "raid", "ccd "};
snprintf(dev_name, sizeof(dev_name), "/dev/r%sc", diskdev);
/*
* Open the disk as a raw device
*/
if ((fd = open(devname, O_RDONLY, 0)) < 0)
if ((fd = open(dev_name, O_RDONLY, 0)) < 0)
return 0;
/*
* Get the "new" label to see if we were successful. If we aren't

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.18 2003/06/14 12:58:49 dsl Exp $ */
/* $NetBSD: md.h,v 1.19 2003/07/25 08:26:28 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -57,7 +57,7 @@
typedef struct {
int type; /* Entry type from above */
char *name; /* Partition Type string */
const char *name; /* Partition Type string */
} MAP_TYPE;
/*
@ -246,7 +246,7 @@ EXTERN struct apple_part_map_entry new_map[]
/*
* Default fileystem type for floppy disks.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*
* prototypes for MD code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.29 2003/06/13 11:57:31 dsl Exp $ */
/* $NetBSD: md.c,v 1.30 2003/07/25 08:26:28 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -66,19 +66,19 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf (devname, 100, "/dev/r%sc", diskdev);
snprintf (dev_name, 100, "/dev/r%sc", diskdev);
fd = open (devname, O_RDONLY, 0);
fd = open (dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf (stderr, "Can't open %s\n", devname);
fprintf (stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf (stderr, "Can't read disklabel on %s.\n", devname);
fprintf (stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.11 2003/06/11 21:35:44 dsl Exp $ */
/* $NetBSD: md.h,v 1.12 2003/07/25 08:26:28 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -60,4 +60,4 @@
/*
* Default file system type for floppies.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.5 2003/06/13 11:57:32 dsl Exp $ */
/* $NetBSD: md.c,v 1.6 2003/07/25 08:26:29 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -69,24 +69,24 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
if (logging)
(void)fprintf(logfp, "Can't open %s\n", devname);
(void)fprintf(logfp, "Can't open %s\n", dev_name);
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
if (logging)
(void)fprintf(logfp, "Can't read disklabel on %s.\n",
devname);
dev_name);
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.7 2003/06/13 11:57:32 dsl Exp $ */
/* $NetBSD: md.h,v 1.8 2003/07/25 08:26:29 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -80,4 +80,4 @@
*
* On NetBSD/mipsco, we don't currently support a dedicated floppy-disk drive
*/
EXTERN char *fdtype INIT("");
EXTERN const char *fdtype INIT("");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.9 2003/06/16 10:42:51 dsl Exp $ */
/* $NetBSD: md.c,v 1.10 2003/07/25 08:26:29 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -57,25 +57,25 @@ md_get_info(void)
{
char buf[1024];
int fd;
char devname[100];
char dev_name[100];
struct disklabel disklabel;
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
if (logging)
(void)fprintf(logfp, "Can't open %s\n", devname);
(void)fprintf(logfp, "Can't open %s\n", dev_name);
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
if (logging)
(void)fprintf(logfp, "Can't read disklabel on %s.\n",
devname);
dev_name);
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}
@ -95,7 +95,7 @@ md_get_info(void)
if (read(fd, buf, 1024) < 0) {
endwin();
fprintf(stderr, "Can't read %s\n", devname);
fprintf(stderr, "Can't read %s\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.6 2003/06/13 11:57:32 dsl Exp $ */
/* $NetBSD: md.h,v 1.7 2003/07/25 08:26:29 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -91,4 +91,4 @@
* Default fileystem type for floppy disks.
* On mvme68k, if we had floppies, that would be ffs.
*/
EXTERN char *fdtype INIT("ffs");
EXTERN const char *fdtype INIT("ffs");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.18 2003/06/13 11:57:32 dsl Exp $ */
/* $NetBSD: md.c,v 1.19 2003/07/25 08:26:30 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -72,19 +72,19 @@ md_get_info()
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf (devname, 100, "/dev/r%sc", diskdev);
snprintf (dev_name, 100, "/dev/r%sc", diskdev);
fd = open (devname, O_RDONLY, 0);
fd = open (dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf (stderr, "Can't open %s\n", devname);
fprintf (stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf (stderr, "Can't read disklabel on %s.\n", devname);
fprintf (stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.16 2003/06/14 12:58:49 dsl Exp $ */
/* $NetBSD: md.h,v 1.17 2003/07/25 08:26:30 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -76,5 +76,5 @@
/*
* Default file system type for floppies.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.7 2003/06/13 11:57:33 dsl Exp $ */
/* $NetBSD: md.c,v 1.8 2003/07/25 08:26:30 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -72,19 +72,19 @@ md_get_info()
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf (devname, 100, "/dev/r%sc", diskdev);
snprintf (dev_name, 100, "/dev/r%sc", diskdev);
fd = open (devname, O_RDONLY, 0);
fd = open (dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf (stderr, "Can't open %s\n", devname);
fprintf (stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf (stderr, "Can't read disklabel on %s.\n", devname);
fprintf (stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.6 2003/06/13 11:57:33 dsl Exp $ */
/* $NetBSD: md.h,v 1.7 2003/07/25 08:26:30 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -74,4 +74,4 @@
/*
* Default file system type for floppies.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.14 2003/06/11 21:35:46 dsl Exp $ */
/* $NetBSD: md.h,v 1.15 2003/07/25 08:26:31 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -63,4 +63,4 @@
#define MD_SETS_VALID SET_SYSTEM
EXTERN char *fdtype INIT("");
EXTERN const char *fdtype INIT("");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.9 2003/06/13 11:57:33 dsl Exp $ */
/* $NetBSD: md.h,v 1.10 2003/07/25 08:26:31 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -76,4 +76,4 @@
* Default fileystem type for IDE disk.
* On playstation2, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.51 2003/06/13 11:57:34 dsl Exp $ */
/* $NetBSD: md.c,v 1.52 2003/07/25 08:26:31 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -69,24 +69,24 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
if (logging)
(void)fprintf(logfp, "Can't open %s\n", devname);
(void)fprintf(logfp, "Can't open %s\n", dev_name);
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
if (logging)
(void)fprintf(logfp, "Can't read disklabel on %s.\n",
devname);
dev_name);
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.25 2003/06/13 11:57:34 dsl Exp $ */
/* $NetBSD: md.h,v 1.26 2003/07/25 08:26:32 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -77,5 +77,5 @@
* On pmax, we don't support a dedicated floppy-disk driver, only
* SCSI floppy drives, so we can't recognize floppies by name.
*/
EXTERN char *fdtype INIT("");
EXTERN const char *fdtype INIT("");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.7 2003/06/13 11:57:34 dsl Exp $ */
/* $NetBSD: md.h,v 1.8 2003/07/25 08:26:32 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -96,7 +96,7 @@
* Default fileystem type for floppy disks.
* On prep, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.6 2003/06/11 21:35:48 dsl Exp $ */
/* $NetBSD: md.h,v 1.7 2003/07/25 08:26:32 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -76,7 +76,7 @@
* Default fileystem type for floppy disks.
* On bebox, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.11 2003/06/13 11:57:34 dsl Exp $ */
/* $NetBSD: md.h,v 1.12 2003/07/25 08:26:33 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -85,5 +85,5 @@
* On sgimips, we don't support a dedicated floppy-disk driver, only
* SCSI floppy drives, so we can't recognize floppies by name.
*/
EXTERN char *fdtype INIT("");
EXTERN const char *fdtype INIT("");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.12 2003/07/11 15:29:04 dsl Exp $ */
/* $NetBSD: md.c,v 1.13 2003/07/25 08:26:33 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -58,24 +58,24 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
if (strncmp(diskdev, "wd", 2) == 0)
disktype = "ST506";
else
disktype = "SCSI";
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.8 2003/06/14 12:58:50 dsl Exp $ */
/* $NetBSD: md.h,v 1.9 2003/07/25 08:26:33 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -66,7 +66,7 @@
* Default fileystem type for floppy disks.
* On shark, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");
/*
* prototypes for MD code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.36 2003/06/13 11:57:35 dsl Exp $ */
/* $NetBSD: md.c,v 1.37 2003/07/25 08:26:33 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -63,24 +63,24 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf(devname, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
snprintf(dev_name, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
if (logging)
(void)fprintf(logfp, "Can't open %s\n", devname);
(void)fprintf(logfp, "Can't open %s\n", dev_name);
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
if (logging)
(void)fprintf(logfp, "Can't read disklabel on %s.\n",
devname);
dev_name);
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.18 2003/06/14 12:58:51 dsl Exp $ */
/* $NetBSD: md.h,v 1.19 2003/07/25 08:26:34 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -79,4 +79,4 @@
/*
* Default file system type for floppies.
*/
EXTERN char *fdtype INIT("ffs");
EXTERN const char *fdtype INIT("ffs");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.12 2003/06/13 11:57:35 dsl Exp $ */
/* $NetBSD: md.c,v 1.13 2003/07/25 08:26:34 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -61,24 +61,24 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
if (logging)
(void)fprintf(logfp, "Can't open %s\n", devname);
(void)fprintf(logfp, "Can't open %s\n", dev_name);
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
if (logging)
(void)fprintf(logfp, "Can't read disklabel on %s.\n",
devname);
dev_name);
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.9 2003/06/13 11:57:36 dsl Exp $ */
/* $NetBSD: md.h,v 1.10 2003/07/25 08:26:34 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -72,4 +72,4 @@
/*
* Default file system type for floppies.
*/
EXTERN char *fdtype INIT("ffs");
EXTERN const char *fdtype INIT("ffs");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.22 2003/06/13 11:57:36 dsl Exp $ */
/* $NetBSD: md.c,v 1.23 2003/07/25 08:26:34 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -61,24 +61,24 @@ md_get_info(void)
{
struct disklabel disklabel;
int fd;
char devname[100];
char dev_name[100];
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
if (logging)
(void)fprintf(logfp, "Can't open %s\n", devname);
(void)fprintf(logfp, "Can't open %s\n", dev_name);
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
if (logging)
(void)fprintf(logfp, "Can't read disklabel on %s.\n",
devname);
dev_name);
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.15 2003/06/14 12:58:51 dsl Exp $ */
/* $NetBSD: md.h,v 1.16 2003/07/25 08:26:34 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -77,5 +77,5 @@
/*
* Default file system type for floppies.
*/
EXTERN char *fdtype INIT("ffs");
EXTERN const char *fdtype INIT("ffs");

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.24 2003/06/16 10:42:51 dsl Exp $ */
/* $NetBSD: md.c,v 1.25 2003/07/25 08:26:34 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -73,25 +73,25 @@ md_get_info(void)
{
char buf[1024];
int fd;
char devname[100];
char dev_name[100];
struct disklabel disklabel;
snprintf(devname, 100, "/dev/r%sc", diskdev);
snprintf(dev_name, 100, "/dev/r%sc", diskdev);
fd = open(devname, O_RDONLY, 0);
fd = open(dev_name, O_RDONLY, 0);
if (fd < 0) {
if (logging)
(void)fprintf(logfp, "Can't open %s\n", devname);
(void)fprintf(logfp, "Can't open %s\n", dev_name);
endwin();
fprintf(stderr, "Can't open %s\n", devname);
fprintf(stderr, "Can't open %s\n", dev_name);
exit(1);
}
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
if (logging)
(void)fprintf(logfp, "Can't read disklabel on %s.\n",
devname);
dev_name);
endwin();
fprintf(stderr, "Can't read disklabel on %s.\n", devname);
fprintf(stderr, "Can't read disklabel on %s.\n", dev_name);
close(fd);
exit(1);
}
@ -111,7 +111,7 @@ md_get_info(void)
if (read(fd, buf, 1024) < 0) {
endwin();
fprintf(stderr, "Can't read %s\n", devname);
fprintf(stderr, "Can't read %s\n", dev_name);
close(fd);
exit(1);
}
@ -121,7 +121,7 @@ md_get_info(void)
else
if (read(fd, md_disklabel, sizeof(md_disklabel)) < 0) {
endwin();
fprintf(stderr, "Can't read %s\n", devname);
fprintf(stderr, "Can't read %s\n", dev_name);
close(fd);
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.12 2003/06/13 11:57:37 dsl Exp $ */
/* $NetBSD: md.h,v 1.13 2003/07/25 08:26:35 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -96,4 +96,4 @@
* Default fileystem type for floppy disks.
* On x68k, that is msdos.
*/
EXTERN char *fdtype INIT("msdos");
EXTERN const char *fdtype INIT("msdos");

View File

@ -1,4 +1,4 @@
/* $NetBSD: bsddisklabel.c,v 1.19 2003/07/07 12:30:19 dsl Exp $ */
/* $NetBSD: bsddisklabel.c,v 1.20 2003/07/25 08:26:21 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -342,7 +342,7 @@ set_ptn_size(menudesc *m, menu_ent *opt, void *arg)
}
static void
get_ptn_sizes(int layoutkind, int part_start, int sectors)
get_ptn_sizes(int layout_kind, int part_start, int sectors)
{
int i;
int maxpart = getmaxpartitions();

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.98 2003/07/19 22:07:36 abs Exp $ */
/* $NetBSD: defs.h,v 1.99 2003/07/25 08:26:21 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -127,7 +127,7 @@ extern const char * const fstypenames[];
/* Types */
typedef struct distinfo {
char *name;
const char *name;
int set;
const char *desc;
} distinfo;
@ -178,7 +178,7 @@ EXTERN unsigned int rammb INIT(0);
/* Actual name of the disk. */
EXTERN char diskdev[SSTRSIZE] INIT("");
EXTERN int rootpart; /* partition we install into */
EXTERN char *disktype INIT("unknown"); /* ST506, SCSI, ... */
EXTERN const char *disktype INIT("unknown"); /* ST506, SCSI, ... */
/* Area of disk we can allocate, start and size in disk sectors. */
EXTERN int ptstart, ptsize;
@ -198,7 +198,7 @@ EXTERN int tmp_mfs_size INIT(0);
#define DISKNAME_SIZE 80
EXTERN char bsddiskname[DISKNAME_SIZE];
EXTERN char *doessf INIT("");
EXTERN const char *doessf INIT("");
/* other vars for menu communication */
EXTERN int nodist;
@ -352,7 +352,7 @@ int get_via_floppy(void);
int get_via_cdrom(void);
int get_via_localfs(void);
int get_via_localdir(void);
void cd_dist_dir(char *);
void cd_dist_dir(const char *);
void show_cur_distsets(void);
void make_ramdisk_dir(const char *);
void ask_verbose_dist(void);
@ -386,7 +386,7 @@ int target_chdir(const char *);
void target_chdir_or_die(const char *);
int target_already_root(void);
FILE *target_fopen(const char *, const char *);
int target_collect_file(int, char **, char *);
int target_collect_file(int, char **, const char *);
int is_active_rootpart(const char *);
int cp_to_target(const char *, const char *);
void dup_file_into_target(const char *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: disks.c,v 1.64 2003/07/11 15:28:58 dsl Exp $ */
/* $NetBSD: disks.c,v 1.65 2003/07/25 08:26:21 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -93,12 +93,12 @@ static int target_mount_with_error_menu(const char *, char *, const char *);
#define DISK_NAMES "wd", "sd", "ld"
#endif
static char *disk_names[] = { DISK_NAMES, "vnd", NULL };
static const char *disk_names[] = { DISK_NAMES, "vnd", NULL };
static int
get_disks(struct disk_desc *dd)
{
char **xd;
const char **xd;
char d_name[SSTRSIZE];
struct disklabel l;
int i;
@ -273,8 +273,8 @@ write_disklabel (void)
static int
ptn_sort(const void *a, const void *b)
{
return strcmp(bsdlabel[*(int *)a].pi_mount,
bsdlabel[*(int *)b].pi_mount);
return strcmp(bsdlabel[*(const int *)a].pi_mount,
bsdlabel[*(const int *)b].pi_mount);
}
int
@ -485,7 +485,7 @@ static int
do_fsck(const char *diskpart)
{
char rraw[SSTRSIZE];
char *prog = "/sbin/fsck";
const char *prog = "/sbin/fsck";
int err;
/* cons up raw partition name. */
@ -640,7 +640,7 @@ fsck_disks(void)
}
int
set_swap(const char *dev, partinfo *pp)
set_swap(const char *disk, partinfo *pp)
{
int i;
char *cp;
@ -652,7 +652,7 @@ set_swap(const char *dev, partinfo *pp)
for (i = 0; i < MAXPARTITIONS; i++) {
if (pp[i].pi_fstype != FS_SWAP)
continue;
asprintf(&cp, "/dev/%s%c", dev, 'a' + i);
asprintf(&cp, "/dev/%s%c", disk, 'a' + i);
rval = swapctl(SWAP_ON, cp, 0);
free(cp);
if (rval != 0)
@ -663,7 +663,7 @@ set_swap(const char *dev, partinfo *pp)
}
int
check_swap(const char *dev, int remove)
check_swap(const char *disk, int remove_swap)
{
struct swapent *swap;
char *cp;
@ -683,20 +683,20 @@ check_swap(const char *dev, int remove)
if (nswap < 0)
goto bad_swap;
l = strlen(dev);
l = strlen(disk);
while (--nswap >= 0) {
/* Should we check the se_dev or se_path? */
cp = swap[nswap].se_path;
if (memcmp(cp, "/dev/", 5) != 0)
continue;
if (memcmp(cp + 5, dev, l) != 0)
if (memcmp(cp + 5, disk, l) != 0)
continue;
if (!isalpha(*(unsigned char *)(cp + 5 + l)))
continue;
if (cp[5 + l + 1] != 0)
continue;
/* ok path looks like it is for this device */
if (!remove) {
if (!remove_swap) {
/* count active swap areas */
rval++;
continue;

View File

@ -1,4 +1,4 @@
/* $NetBSD: install.c,v 1.36 2003/06/27 22:20:15 dsl Exp $ */
/* $NetBSD: install.c,v 1.37 2003/07/25 08:26:21 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -75,7 +75,8 @@ do_install(void)
/* if we need the user to mount root, ask them to. */
if (must_mount_root()) {
msg_display(MSG_pleasemountroot, diskdev, diskdev, diskdev, diskdev);
msg_display(MSG_pleasemountroot,
diskdev, diskdev, diskdev, diskdev);
process_menu(MENU_ok, NULL);
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: label.c,v 1.35 2003/07/08 17:38:56 dsl Exp $ */
/* $NetBSD: label.c,v 1.36 2003/07/25 08:26:21 dsl Exp $ */
/*
* Copyright 1997 Jonathan Stone
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: label.c,v 1.35 2003/07/08 17:38:56 dsl Exp $");
__RCSID("$NetBSD: label.c,v 1.36 2003/07/25 08:26:21 dsl Exp $");
#endif
#include <sys/types.h>
@ -607,7 +607,7 @@ get_last_mounted(int fd, int partstart)
const static int sblocks[] = SBLOCKSEARCH;
const int *sbp;
char *cp;
char *mnt = "";
const char *mnt = "";
int l;
if (fd == -1)

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbr.c,v 1.48 2003/07/14 09:59:00 dsl Exp $ */
/* $NetBSD: mbr.c,v 1.49 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -85,7 +85,7 @@
struct part_id {
int id;
char *name;
const char *name;
} part_ids[] = {
{0, "unused"},
{MBR_PTYPE_NETBSD, "NetBSD"},
@ -181,7 +181,7 @@ remove_old_partitions(uint start, int size)
}
static int
find_mbr_space(mbr_sector_t *mbr, uint *start, uint *size, int from, int ignore)
find_mbr_space(mbr_sector_t *mbrs, uint *start, uint *size, int from, int ignore)
{
int sz;
int i;
@ -192,8 +192,8 @@ find_mbr_space(mbr_sector_t *mbr, uint *start, uint *size, int from, int ignore)
for (i = 0; i < NMBRPART; i++) {
if (i == ignore)
continue;
s = mbr->mbr_parts[i].mbrp_start;
e = s + mbr->mbr_parts[i].mbrp_size;
s = mbrs->mbr_parts[i].mbrp_start;
e = s + mbrs->mbr_parts[i].mbrp_size;
if (s <= from && e > from) {
from = e;
goto check_again;
@ -1078,7 +1078,7 @@ set_mbr_header(menudesc *m, void *arg)
int
edit_mbr(mbr_info_t *mbri)
{
mbr_sector_t *mbr = &mbri->mbr;
mbr_sector_t *mbrs = &mbri->mbr;
mbr_info_t *ext;
struct mbr_partition *part;
int i, j;
@ -1091,7 +1091,7 @@ edit_mbr(mbr_info_t *mbri)
/* Ask full/part */
part = &mbr->mbr_parts[0];
part = &mbrs->mbr_parts[0];
msg_display(MSG_fullpart, diskdev);
process_menu(MENU_fullpart, &usefull);
@ -1209,7 +1209,7 @@ edit_mbr(mbr_info_t *mbri)
return 1;
}
char *
const char *
get_partname(int typ)
{
int j;
@ -1227,7 +1227,7 @@ int
read_mbr(const char *disk, mbr_info_t *mbri)
{
struct mbr_partition *mbrp;
mbr_sector_t *mbr = &mbri->mbr;
mbr_sector_t *mbrs = &mbri->mbr;
mbr_info_t *ext = NULL;
char diskpath[MAXPATHLEN];
int fd, i;
@ -1246,14 +1246,14 @@ read_mbr(const char *disk, mbr_info_t *mbri)
goto bad_mbr;
for (;;) {
if (pread(fd, mbr, sizeof *mbr,
(ext_base + next_ext) * (off_t)MBR_SECSIZE) < sizeof *mbr)
if (pread(fd, mbrs, sizeof *mbrs,
(ext_base + next_ext) * (off_t)MBR_SECSIZE) < sizeof *mbrs)
break;
if (!valid_mbr(mbr))
if (!valid_mbr(mbrs))
break;
mbrp = &mbr->mbr_parts[0];
mbrp = &mbrs->mbr_parts[0];
if (ext_base != 0) {
/* sanity check extended chain */
if (MBR_IS_EXTENDED(mbrp[0].mbrp_typ))
@ -1271,14 +1271,14 @@ read_mbr(const char *disk, mbr_info_t *mbri)
}
#if BOOTSEL
else {
if (mbr->mbr_bootsel.mbrb_magic == htole16(MBR_MAGIC))
bootkey = mbr->mbr_bootsel.mbrb_defkey;
if (mbrs->mbr_bootsel.mbrb_magic == htole16(MBR_MAGIC))
bootkey = mbrs->mbr_bootsel.mbrb_defkey;
else
bootkey = 0;
bootkey -= SCAN_1;
}
if (mbr->mbr_bootsel.mbrb_magic == htole16(MBR_MAGIC))
memcpy(mbri->nametab, mbr->mbr_bootsel.mbrb_nametab,
if (mbrs->mbr_bootsel.mbrb_magic == htole16(MBR_MAGIC))
memcpy(mbri->nametab, mbrs->mbr_bootsel.mbrb_nametab,
sizeof mbri->nametab);
#endif
mbri->sector = next_ext + ext_base;
@ -1349,7 +1349,7 @@ read_mbr(const char *disk, mbr_info_t *mbri)
ext = malloc(sizeof *ext);
if (!ext)
break;
mbr = &ext->mbr;
mbrs = &ext->mbr;
}
bad_mbr:
@ -1357,8 +1357,8 @@ read_mbr(const char *disk, mbr_info_t *mbri)
if (fd >= 0)
close(fd);
if (rval == -1) {
memset(&mbr->mbr_parts, 0, sizeof mbr->mbr_parts);
mbr->mbr_signature = htole16(MBR_MAGIC);
memset(&mbrs->mbr_parts, 0, sizeof mbrs->mbr_parts);
mbrs->mbr_signature = htole16(MBR_MAGIC);
}
return rval;
}
@ -1370,7 +1370,7 @@ write_mbr(const char *disk, mbr_info_t *mbri, int convert)
int fd, i, ret = 0;
struct mbr_partition *mbrp;
u_int32_t pstart, psize;
mbr_sector_t *mbr;
mbr_sector_t *mbrs;
mbr_info_t *ext;
#ifdef BOOTSEL
int netbsd_bootcode;
@ -1389,15 +1389,15 @@ write_mbr(const char *disk, mbr_info_t *mbri, int convert)
return -1;
for (ext = mbri; ext != NULL; ext = ext->extended) {
mbr = &ext->mbr;
mbrs = &ext->mbr;
#ifdef BOOTSEL
if (netbsd_bootcode) {
mbr->mbr_bootsel.mbrb_magic = htole16(MBR_MAGIC);
memcpy(&mbr->mbr_bootsel.mbrb_nametab, &ext->nametab,
sizeof mbr->mbr_bootsel.mbrb_nametab);
mbrs->mbr_bootsel.mbrb_magic = htole16(MBR_MAGIC);
memcpy(&mbrs->mbr_bootsel.mbrb_nametab, &ext->nametab,
sizeof mbrs->mbr_bootsel.mbrb_nametab);
}
#endif
mbrp = &mbr->mbr_parts[0];
mbrp = &mbrs->mbr_parts[0];
for (i = 0; i < NMBRPART; i++) {
if (mbrp[i].mbrp_start == 0 && mbrp[i].mbrp_size == 0) {
mbrp[i].mbrp_scyl = 0;
@ -1429,12 +1429,12 @@ write_mbr(const char *disk, mbr_info_t *mbri, int convert)
#endif
}
mbr->mbr_signature = htole16(MBR_MAGIC);
mbrs->mbr_signature = htole16(MBR_MAGIC);
/*
* Sector zero is written outside the loop after we have
* set mbrb_defkey.
*/
if (ext->sector != 0 && pwrite(fd, mbr, sizeof *mbr,
if (ext->sector != 0 && pwrite(fd, mbrs, sizeof *mbrs,
ext->sector * (off_t)MBR_SECSIZE) < 0)
ret = -1;
}
@ -1447,10 +1447,10 @@ write_mbr(const char *disk, mbr_info_t *mbri, int convert)
}
int
valid_mbr(mbr_sector_t *mbr)
valid_mbr(mbr_sector_t *mbrs)
{
return (le16toh(mbr->mbr_signature) == MBR_MAGIC);
return (le16toh(mbrs->mbr_signature) == MBR_MAGIC);
}
static void
@ -1494,8 +1494,8 @@ convert_mbr_chs(int cyl, int head, int sec,
int
guess_biosgeom_from_mbr(mbr_info_t *mbri, int *cyl, int *head, int *sec)
{
mbr_sector_t *mbr = &mbri->mbr;
struct mbr_partition *parts = &mbr->mbr_parts[0];
mbr_sector_t *mbrs = &mbri->mbr;
struct mbr_partition *parts = &mbrs->mbr_parts[0];
int xcylinders, xheads, xsectors, i, j;
int c1, h1, s1, c2, h2, s2;
unsigned long a1, a2;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbr.h,v 1.16 2003/07/07 12:30:20 dsl Exp $ */
/* $NetBSD: mbr.h,v 1.17 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997, 1988 Piermont Information Systems Inc.
@ -104,7 +104,7 @@ int md_bios_info(char *);
void set_bios_geom(int, int, int);
int otherpart(int);
int ourpart(int);
char *get_partname(int);
const char *get_partname(int);
void edit_ptn_bounds(void);
#ifdef BOOTSEL
void disp_bootsel(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi,v 1.8 2003/07/18 10:29:36 dsl Exp $ */
/* $NetBSD: menus.mi,v 1.9 2003/07/25 08:26:22 dsl Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -274,7 +274,7 @@ menu localdirsource, title MSG_Change;
menu localdirbad, title MSG_What_do_you_want_to_do;
display action
{ msg_display(MSG_localdir, localfs_dir);
msg_display_add(arg, localfs_dir); };
msg_display_add(*(msg *)arg, localfs_dir); };
option MSG_Change_directory_path, exit, action
{ yesno = 1;
msg_prompt_win(MSG_dir, -1, 12, 0, 0, NULL, localfs_dir, 60); };

View File

@ -1,4 +1,4 @@
/* $NetBSD: net.c,v 1.90 2003/07/22 11:45:16 dsl Exp $ */
/* $NetBSD: net.c,v 1.91 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -99,8 +99,8 @@ static void write_etc_hosts(FILE *f);
#define DHCLIENT_EX "/sbin/dhclient"
#include <signal.h>
static int config_dhcp(char *);
static void get_command_out(char *, int, char *, char *);
static void get_dhcp_value(char *, char *);
static void get_command_out(char *, int, const char *, const char *);
static void get_dhcp_value(char *, const char *);
#ifdef INET6
static int is_v6kernel (void);
@ -1047,11 +1047,11 @@ config_dhcp(char *inter)
}
static void
get_command_out(char *targ, int af, char *command, char *search)
get_command_out(char *targ, int af, const char *command, const char *search)
{
int textsize;
char *textbuf;
char *t;
const char *t;
#ifndef INET6
struct in_addr in;
#else
@ -1083,7 +1083,7 @@ get_command_out(char *targ, int af, char *command, char *search)
}
static void
get_dhcp_value(char *targ, char *line)
get_dhcp_value(char *targ, const char *line)
{
int textsize;
char *textbuf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: run.c,v 1.45 2003/07/18 09:34:42 dsl Exp $ */
/* $NetBSD: run.c,v 1.46 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -417,7 +417,7 @@ launch_subwin(WINDOW *actionwin, char **args, struct winsize *win, int flags,
for (selectfailed = 0;;) {
if (selectfailed) {
char *mmsg = "select(2) failed but no child died?";
const char *mmsg = "select(2) failed but no child died?";
if(logging)
(void)fprintf(logfp, mmsg);
errx(1, mmsg);

View File

@ -1,4 +1,4 @@
/* $NetBSD: target.c,v 1.38 2003/07/08 17:38:58 dsl Exp $ */
/* $NetBSD: target.c,v 1.39 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997 Jonathan Stone
@ -75,7 +75,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: target.c,v 1.38 2003/07/08 17:38:58 dsl Exp $");
__RCSID("$NetBSD: target.c,v 1.39 2003/07/25 08:26:22 dsl Exp $");
#endif
/*
@ -687,7 +687,7 @@ target_mount(const char *fstype, const char *from, const char *on)
}
int
target_collect_file(int kind, char **buffer, char *name)
target_collect_file(int kind, char **buffer, const char *name)
{
const char *realname = target_expand(name);
@ -787,6 +787,7 @@ target_realpath(const char *path, char *resolved)
struct stat sb;
int fd, n, rootd, serrno, nlnk = 0;
char *p, *q, wbuf[MAXPATHLEN];
char solidus[] = "/", empty[] = "";
/* Save the starting point. */
if ((fd = open(".", O_RDONLY)) < 0) {
@ -813,7 +814,7 @@ loop:
if (q != NULL) {
p = q + 1;
if (q == resolved)
q = "/";
q = solidus;
else {
do {
--q;
@ -847,7 +848,7 @@ loop:
if (S_ISDIR(sb.st_mode)) {
if (chdir(p) < 0)
goto err1;
p = "";
p = empty;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: txtwalk.c,v 1.8 2003/06/16 19:42:14 dsl Exp $ */
/* $NetBSD: txtwalk.c,v 1.9 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -122,7 +122,7 @@ process(struct lookfor *item, char *line)
{
struct data found[MAXDATA];
size_t numfound = 0;
char *p;
const char *p;
size_t i, j;
if (finddata(item, line, found, &numfound)) {
@ -191,7 +191,7 @@ process(struct lookfor *item, char *line)
static int
finddata(struct lookfor *item, char *line, struct data *found, size_t *numfound)
{
char *fmt = item->fmt;
const char *fmt = item->fmt;
size_t len;
*numfound = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: txtwalk.h,v 1.7 2003/01/10 20:00:28 christos Exp $ */
/* $NetBSD: txtwalk.h,v 1.8 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -51,9 +51,9 @@ struct data {
/* Strings of interest! */
struct lookfor {
char *head; /* Line starts this way. */
char *fmt; /* Expected format. */
char *todo; /* What to do ... */
const char *head; /* Line starts this way. */
const char *fmt; /* Expected format. */
const char *todo; /* What to do ... */
void *var; /* Possible var */
size_t nument; /* Number of entries in the "array" */
size_t size; /* size of string variables */

View File

@ -1,4 +1,4 @@
/* $NetBSD: upgrade.c,v 1.39 2003/07/22 12:18:39 dsl Exp $ */
/* $NetBSD: upgrade.c,v 1.40 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -80,7 +80,8 @@ do_upgrade(void)
/* if we need the user to mount root, ask them to. */
if (must_mount_root()) {
msg_display(MSG_pleasemountroot, diskdev, diskdev, diskdev, diskdev);
msg_display(MSG_pleasemountroot,
diskdev, diskdev, diskdev, diskdev);
process_menu(MENU_ok, NULL);
return;
}
@ -287,7 +288,8 @@ do_reinstall_sets(void)
/* if we need the user to mount root, ask them to. */
if (must_mount_root()) {
msg_display(MSG_pleasemountroot, diskdev, diskdev, diskdev, diskdev);
msg_display(MSG_pleasemountroot,
diskdev, diskdev, diskdev, diskdev);
process_menu(MENU_ok, NULL);
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.c,v 1.106 2003/07/22 08:30:11 dsl Exp $ */
/* $NetBSD: util.c,v 1.107 2003/07/25 08:26:22 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -267,7 +267,7 @@ get_via_floppy(void)
first = 1;
while (!mounted || stat(full_name, &sb)) {
if (mounted)
run_prog(0, NULL, "/sbin/umount /mnt2");
run_prog(0, NULL, "/sbin/umount /mnt2");
if (first)
msg_display(MSG_fdmount, fname);
else
@ -415,27 +415,19 @@ again:
int
get_via_localdir(void)
{
msg errmsg;
/* Get device, filesystem, and filepath */
process_menu(MENU_localdirsource, NULL);
again:
/* Complain if not a directory */
if (dir_exists_p(localfs_dir) == 0) {
process_menu(MENU_localdirbad, (void *)MSG_badlocalsetdir);
/* Complain if not a directory or distribution files absent */
while ((dir_exists_p(localfs_dir) == 0 && (errmsg = MSG_badlocalsetdir)) ||
(distribution_sets_exist_p(localfs_dir) == 0 && (errmsg = MSG_badsetdir))) {
process_menu(MENU_localdirbad, &errmsg);
if (!yesno)
return (0);
if (!ignorerror)
goto again;
}
/* Verify distribution files exist. */
if (distribution_sets_exist_p(localfs_dir) == 0) {
process_menu(MENU_localdirbad, (void *)MSG_badsetdir);
if (!yesno)
return (0);
if (!ignorerror)
goto again;
if (ignorerror)
break;
}
/* return location, don't clean... */
@ -447,7 +439,7 @@ again:
void
cd_dist_dir(char *forwhat)
cd_dist_dir(const char *forwhat)
{
/* ask user for the mountpoint. */
@ -1234,7 +1226,7 @@ timezone_sig(int sig)
static int
tz_sort(const void *a, const void *b)
{
return strcmp(((menu_ent *)a)->opt_name, ((menu_ent *)b)->opt_name);
return strcmp(((const menu_ent *)a)->opt_name, ((const menu_ent *)b)->opt_name);
}
static void