diff options
author | marcel <marcel@FreeBSD.org> | 2010-06-13 23:37:16 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2010-06-13 23:37:16 +0000 |
commit | f33a608ccec24dc55299338ef565a8eb3356ff64 (patch) | |
tree | 739fd79d6d058319df6260c7cb1feb3ee3fc78be | |
parent | 47283486dae64d53f3e1ba5b0b3a6ea175cb8262 (diff) | |
download | FreeBSD-src-f33a608ccec24dc55299338ef565a8eb3356ff64.zip FreeBSD-src-f33a608ccec24dc55299338ef565a8eb3356ff64.tar.gz |
Fix build breakages on ia64 introduced some commits ago.
-rw-r--r-- | usr.sbin/sysinstall/disks.c | 71 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 2 |
2 files changed, 37 insertions, 36 deletions
diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index c0fd12a..c911ef0 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -79,7 +79,6 @@ static struct chunk *chunk_info[CHUNK_INFO_ENTRIES]; static int current_chunk; static void diskPartitionNonInteractive(Device *dev); -static u_char * bootalloc(char *name, size_t *size); static void record_chunks(Disk *d) @@ -217,6 +216,41 @@ print_command_summary(void) move(0, 0); } +#if !defined(__ia64__) +static u_char * +bootalloc(char *name, size_t *size) +{ + char buf[FILENAME_MAX]; + struct stat sb; + + snprintf(buf, sizeof buf, "/boot/%s", name); + if (stat(buf, &sb) != -1) { + int fd; + + fd = open(buf, O_RDONLY); + if (fd != -1) { + u_char *cp; + + cp = malloc(sb.st_size); + if (read(fd, cp, sb.st_size) != sb.st_size) { + free(cp); + close(fd); + msgDebug("bootalloc: couldn't read %ld bytes from %s\n", (long)sb.st_size, buf); + return NULL; + } + close(fd); + if (size != NULL) + *size = sb.st_size; + return cp; + } + msgDebug("bootalloc: couldn't open %s\n", buf); + } + else + msgDebug("bootalloc: can't stat %s\n", buf); + return NULL; +} +#endif + #ifdef PC98 static void getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size, @@ -732,39 +766,6 @@ diskPartition(Device *dev) } #endif /* WITH_SLICES */ -static u_char * -bootalloc(char *name, size_t *size) -{ - char buf[FILENAME_MAX]; - struct stat sb; - - snprintf(buf, sizeof buf, "/boot/%s", name); - if (stat(buf, &sb) != -1) { - int fd; - - fd = open(buf, O_RDONLY); - if (fd != -1) { - u_char *cp; - - cp = malloc(sb.st_size); - if (read(fd, cp, sb.st_size) != sb.st_size) { - free(cp); - close(fd); - msgDebug("bootalloc: couldn't read %ld bytes from %s\n", (long)sb.st_size, buf); - return NULL; - } - close(fd); - if (size != NULL) - *size = sb.st_size; - return cp; - } - msgDebug("bootalloc: couldn't open %s\n", buf); - } - else - msgDebug("bootalloc: can't stat %s\n", buf); - return NULL; -} - #ifdef WITH_SLICES static int partitionHook(dialogMenuItem *selected) @@ -874,7 +875,9 @@ diskPartitionWrite(dialogMenuItem *self) msgDebug("diskPartitionWrite: Examining %d devices\n", deviceCount(devs)); for (i = 0; devs[i]; i++) { Disk *d = (Disk *)devs[i]->private; +#if !defined(__ia64__) static u_char *boot1; +#endif #if defined(__i386__) || defined(__amd64__) static u_char *boot2; #endif diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 3a77f8f..e7188fd 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -1191,9 +1191,7 @@ installFilesystems(dialogMenuItem *self) } #if defined(__ia64__) else if (c1->type == efi && c1->private_data) { - char bootdir[FILENAME_MAX]; PartInfo *pi = (PartInfo *)c1->private_data; - char *p; sprintf(dname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c1->name); |