diff --git a/misc/ChangeLog b/misc/ChangeLog index 7b288e73..c125f145 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,5 +1,10 @@ 2005-01-05 Theodore Ts'o + * 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 e2p library to parse the number of blocks from the command line. diff --git a/misc/e2image.c b/misc/e2image.c index 8fecd2d5..9ff35108 100644 --- a/misc/e2image.c +++ b/misc/e2image.c @@ -447,9 +447,8 @@ static void write_raw_image_file(ext2_filsys fs, int 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; ext2_filsys fs; 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); } - retval = io_ptr->open(device_name, IO_FLAG_RW, &io); + retval = io_ptr->open(device, IO_FLAG_RW, &io); if (retval) { - com_err(device_name, 0, "while opening device file"); + com_err(device, 0, "while opening device file"); exit(1); } @@ -555,7 +554,7 @@ int main (int argc, char ** argv) if (install_flag) { install_image(device_name, image_fn, raw_flag); - return; + exit (0); } retval = ext2fs_open (device_name, open_flag, 0, 0, diff --git a/misc/e2initrd_helper.c b/misc/e2initrd_helper.c index 243aab42..26001909 100644 --- a/misc/e2initrd_helper.c +++ b/misc/e2initrd_helper.c @@ -67,13 +67,12 @@ static void usage(void) 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) { errcode_t retval; char *buf; ext2_file_t e2_file; - int nbytes; unsigned int got; struct ext2_inode inode; ext2_ino_t ino; @@ -119,7 +118,7 @@ errout: return retval; } -char *get_line(struct mem_file *file) +static char *get_line(struct mem_file *file) { char *cp, *ret; int s = 0; @@ -142,7 +141,7 @@ char *get_line(struct mem_file *file) return ret; } -int mem_file_eof(struct mem_file *file) +static int mem_file_eof(struct mem_file *file) { return (file->ptr >= file->size); } @@ -280,7 +279,7 @@ static int parse_fstab_line(char *line, struct fs_info *fs) return 0; } -void free_fstab_line(struct fs_info *fs) +static void free_fstab_line(struct fs_info *fs) { if (fs->device) fs->device = 0; @@ -297,9 +296,6 @@ void free_fstab_line(struct fs_info *fs) static void PRS(int argc, char **argv) { int c; - char * tmp; - struct group * gr; - struct passwd * pw; #ifdef ENABLE_NLS 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; struct mem_file file; @@ -366,9 +362,7 @@ int main (int argc, char ** argv) { errcode_t retval; ext2_filsys fs; - struct ext2_super_block *sb; io_manager io_ptr; - int got, ret; initialize_ext2_error_table();