diff options
author | hpa <hpa> | 2005-01-05 01:04:47 +0000 |
---|---|---|
committer | hpa <hpa> | 2005-01-05 01:04:47 +0000 |
commit | ec013c7934485ee3b195ea99f03590a47b8cb0d7 (patch) | |
tree | 1763a1a0c7b80f78429fff5e2ed100ce67a8cd81 /extlinux | |
parent | 80717f76b561e490cf862c87be2e3ef1e5596b37 (diff) | |
download | syslinux-ec013c7934485ee3b195ea99f03590a47b8cb0d7.tar.gz |
Clean up extlinux compilation issues
Diffstat (limited to 'extlinux')
-rw-r--r-- | extlinux/extlinux.c | 19 |
1 files changed, 10 insertions, 9 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); } } |