aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2005-01-05 01:04:47 +0000
committerhpa <hpa>2005-01-05 01:04:47 +0000
commitec013c7934485ee3b195ea99f03590a47b8cb0d7 (patch)
tree1763a1a0c7b80f78429fff5e2ed100ce67a8cd81
parent80717f76b561e490cf862c87be2e3ef1e5596b37 (diff)
downloadsyslinux-elf-ec013c7934485ee3b195ea99f03590a47b8cb0d7.tar.gz
syslinux-elf-ec013c7934485ee3b195ea99f03590a47b8cb0d7.tar.xz
syslinux-elf-ec013c7934485ee3b195ea99f03590a47b8cb0d7.zip
Clean up extlinux compilation issues
-rw-r--r--extlinux/extlinux.c19
-rwxr-xr-xversion.pl2
2 files changed, 11 insertions, 10 deletions
diff --git a/extlinux/extlinux.c b/extlinux/extlinux.c
index 5d1733e6..b9d0d0b7 100644
--- a/extlinux/extlinux.c
+++ b/extlinux/extlinux.c
@@ -49,6 +49,8 @@
/* Global option handling */
+const char *program;
+
/* These are the options we can set and their values */
struct my_options {
unsigned int sectors;
@@ -434,7 +436,6 @@ patch_file_and_bootblock(int fd, int dirfd, int devfd)
unsigned char *p, *patcharea;
int i, dw;
uint32_t csum;
- unsigned int sectors, heads;
if ( fstat(dirfd, &dirst) ) {
perror("fstat dirfd");
@@ -538,7 +539,7 @@ install_bootblock(int fd, const char *device)
}
int
-install_file(char *path, int devfd, struct stat *rst)
+install_file(const char *path, int devfd, struct stat *rst)
{
char *file;
int fd = -1, dirfd = -1, flags;
@@ -626,7 +627,7 @@ install_file(char *path, int devfd, struct stat *rst)
}
int
-install_loader(const char *path, unsigned int sectors, unsigned int heads)
+install_loader(const char *path)
{
struct stat st, dst, fst;
struct mntent *mnt = NULL;
@@ -703,14 +704,14 @@ install_loader(const char *path, unsigned int sectors, unsigned int heads)
int
main(int argc, char *argv[])
{
- program = argv[0];
- int opt;
- unsigned long a;
+ int o;
const char *directory;
- while ( (opt = getopt_long(argc, argv, short_options,
+ program = argv[0];
+
+ while ( (o = getopt_long(argc, argv, short_options,
long_options, NULL)) != EOF ) {
- switch ( opt ) {
+ switch ( o ) {
case 'z':
opt.heads = 64;
opt.sectors = 32;
@@ -738,7 +739,7 @@ main(int argc, char *argv[])
fputs("extlinux " VERSION "\n", stderr);
exit(0);
default:
- fprintf(stderr, "%s: Unknown option: %c\n", optopt);
+ fprintf(stderr, "%s: Unknown option: %c\n", program, optopt);
exit(EX_USAGE);
}
}
diff --git a/version.pl b/version.pl
index 39d42a03..4440369f 100755
--- a/version.pl
+++ b/version.pl
@@ -5,7 +5,7 @@
use Fcntl;
-($vfile, $vout, $def) = $ARGV[0];
+($vfile, $vout, $def) = @ARGV;
sysopen(VERSION, $vfile, O_RDONLY) or die "$0: Cannot open $vfile\n";
$version = <VERSION>;
chomp $version;