Fix gcc -Wall nits.

bitmap-optimize
Theodore Ts'o 2005-01-05 03:02:54 -05:00
parent 55f4cbd96e
commit 6e82cd7e95
3 changed files with 14 additions and 16 deletions

View File

@ -1,5 +1,10 @@
2005-01-05 Theodore Ts'o <tytso@mit.edu> 2005-01-05 Theodore Ts'o <tytso@mit.edu>
* e2initrd_helper.c: Fix gcc -Wall nits.
* e2image.c (main): Fix gcc -Wall nits. Fix e2image so that
e2image -I has an exit code of 0 when it is successful.
* mke2fs.c (PRS, parse_r_opts): Use parse_num_blocks() from the * mke2fs.c (PRS, parse_r_opts): Use parse_num_blocks() from the
e2p library to parse the number of blocks from the command e2p library to parse the number of blocks from the command
line. line.

View File

@ -447,9 +447,8 @@ static void write_raw_image_file(ext2_filsys fs, int fd)
output_meta_data_blocks(fs, fd); output_meta_data_blocks(fs, fd);
} }
void install_image(char *device_name, char *image_fn, int raw_flag) static void install_image(char *device, char *image_fn, int raw_flag)
{ {
int c;
errcode_t retval; errcode_t retval;
ext2_filsys fs; ext2_filsys fs;
int open_flag = EXT2_FLAG_IMAGE_FILE; int open_flag = EXT2_FLAG_IMAGE_FILE;
@ -490,9 +489,9 @@ void install_image(char *device_name, char *image_fn, int raw_flag)
exit(1); exit(1);
} }
retval = io_ptr->open(device_name, IO_FLAG_RW, &io); retval = io_ptr->open(device, IO_FLAG_RW, &io);
if (retval) { if (retval) {
com_err(device_name, 0, "while opening device file"); com_err(device, 0, "while opening device file");
exit(1); exit(1);
} }
@ -555,7 +554,7 @@ int main (int argc, char ** argv)
if (install_flag) { if (install_flag) {
install_image(device_name, image_fn, raw_flag); install_image(device_name, image_fn, raw_flag);
return; exit (0);
} }
retval = ext2fs_open (device_name, open_flag, 0, 0, retval = ext2fs_open (device_name, open_flag, 0, 0,

View File

@ -67,13 +67,12 @@ static void usage(void)
exit (1); exit (1);
} }
errcode_t get_file(ext2_filsys fs, const char * filename, static errcode_t get_file(ext2_filsys fs, const char * filename,
struct mem_file *ret_file) struct mem_file *ret_file)
{ {
errcode_t retval; errcode_t retval;
char *buf; char *buf;
ext2_file_t e2_file; ext2_file_t e2_file;
int nbytes;
unsigned int got; unsigned int got;
struct ext2_inode inode; struct ext2_inode inode;
ext2_ino_t ino; ext2_ino_t ino;
@ -119,7 +118,7 @@ errout:
return retval; return retval;
} }
char *get_line(struct mem_file *file) static char *get_line(struct mem_file *file)
{ {
char *cp, *ret; char *cp, *ret;
int s = 0; int s = 0;
@ -142,7 +141,7 @@ char *get_line(struct mem_file *file)
return ret; return ret;
} }
int mem_file_eof(struct mem_file *file) static int mem_file_eof(struct mem_file *file)
{ {
return (file->ptr >= file->size); return (file->ptr >= file->size);
} }
@ -280,7 +279,7 @@ static int parse_fstab_line(char *line, struct fs_info *fs)
return 0; return 0;
} }
void free_fstab_line(struct fs_info *fs) static void free_fstab_line(struct fs_info *fs)
{ {
if (fs->device) if (fs->device)
fs->device = 0; fs->device = 0;
@ -297,9 +296,6 @@ void free_fstab_line(struct fs_info *fs)
static void PRS(int argc, char **argv) static void PRS(int argc, char **argv)
{ {
int c; int c;
char * tmp;
struct group * gr;
struct passwd * pw;
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
setlocale(LC_MESSAGES, ""); setlocale(LC_MESSAGES, "");
@ -332,7 +328,7 @@ static void PRS(int argc, char **argv)
} }
} }
void get_root_type(ext2_filsys fs) static void get_root_type(ext2_filsys fs)
{ {
errcode_t retval; errcode_t retval;
struct mem_file file; struct mem_file file;
@ -366,9 +362,7 @@ int main (int argc, char ** argv)
{ {
errcode_t retval; errcode_t retval;
ext2_filsys fs; ext2_filsys fs;
struct ext2_super_block *sb;
io_manager io_ptr; io_manager io_ptr;
int got, ret;
initialize_ext2_error_table(); initialize_ext2_error_table();