From: kaku <fk...@us...> - 2006-03-04 23:59:48
|
Update of /cvsroot/mkdump/utils/mkd_conv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12111 Modified Files: mkd_conv.c Log Message: Renamed check_dump_stat to check_dump_cond. Changed options.(-C -> -c, -I -> -i, -P -> -p) Changed a point of a line to check an indicator in copy_dump_no_conv(). Index: mkd_conv.c =================================================================== RCS file: /cvsroot/mkdump/utils/mkd_conv/mkd_conv.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkd_conv.c 3 Mar 2006 00:00:00 -0000 1.1 --- mkd_conv.c 4 Mar 2006 23:59:40 -0000 1.2 *************** *** 52,56 **** static int copy_dump_no_conv(int fd_in, int fd_out, char *file_nm, dump_cache_t *dcache, int chk, u64 *sum); ! static int check_dump_stat(int fd, dump_cache_t *dcache, u64 *blk); static int format_ddev(int fd, char *file_nm, dump_cache_t *dcache, u64 *sum); static int check_devf(int fd, char *file_nm, u64 *size); --- 52,56 ---- static int copy_dump_no_conv(int fd_in, int fd_out, char *file_nm, dump_cache_t *dcache, int chk, u64 *sum); ! static int check_dump_cond(int fd, dump_cache_t *dcache, u64 *blk); static int format_ddev(int fd, char *file_nm, dump_cache_t *dcache, u64 *sum); static int check_devf(int fd, char *file_nm, u64 *size); *************** *** 109,121 **** DPRINT(("Enter %s(%d)\n", __FUNCTION__,__LINE__)); program_name = argv[0]; ! while ((opt = getopt(argc, argv, "CIPcfnsa:d:w:")) > 0) { switch (opt) { ! case 'C': opts_f.f_chk = 1; break; ! case 'I': opts_f.f_info = 1; break; ! case 'P': opts_f.f_format = 1; open_flags = O_RDWR; --- 109,121 ---- DPRINT(("Enter %s(%d)\n", __FUNCTION__,__LINE__)); program_name = argv[0]; ! while ((opt = getopt(argc, argv, "cipfnsa:d:w:")) > 0) { switch (opt) { ! case 'c': opts_f.f_chk = 1; break; ! case 'i': opts_f.f_info = 1; break; ! case 'p': opts_f.f_format = 1; open_flags = O_RDWR; *************** *** 323,327 **** goto L_close; } ! result = check_dump_stat(fd_in, &dcache, &blk); printf("%d %d\n", result, blk); if (result == 0) { --- 323,327 ---- goto L_close; } ! result = check_dump_cond(fd_in, &dcache, &blk); printf("%d %d\n", result, blk); if (result == 0) { *************** *** 613,622 **** } if (rsz != dcache->buf_sz) { - if (per != -1) { - fprintf(stderr, "\n"); - } break; } } while (rsz > 0); return 0; --- 613,622 ---- } if (rsz != dcache->buf_sz) { break; } } while (rsz > 0); + if (per != -1) { + fprintf(stderr, "\n"); + } return 0; *************** *** 624,630 **** /* ! * check dump status */ ! static int check_dump_stat(int fd, dump_cache_t *dcache, u64 *blk) { ssize_t rsz; --- 624,630 ---- /* ! * check dump condition */ ! static int check_dump_cond(int fd, dump_cache_t *dcache, u64 *blk) { ssize_t rsz; *************** *** 638,642 **** *blk = 0; if (dcache->r_dv || dcache->r_dm) { ! fprintf(stderr, "invalid header(in check_dump_stat).\n"); return -1; } --- 638,642 ---- *blk = 0; if (dcache->r_dv || dcache->r_dm) { ! fprintf(stderr, "invalid header(in check_dump_cond).\n"); return -1; } *************** *** 651,655 **** /* check number of dump pages */ if (lseek(fd, dcache->p_sz * 2, SEEK_SET) != dcache->p_sz * 2) { ! perror("lseek dump data(in check_dump_stat)"); return -1; } --- 651,655 ---- /* check number of dump pages */ if (lseek(fd, dcache->p_sz * 2, SEEK_SET) != dcache->p_sz * 2) { ! perror("lseek dump data(in check_dump_cond)"); return -1; } *************** *** 659,663 **** if ((rsz = read(fd, dcache->buf, dcache->buf_sz)) < 0) { ! perror("read dump(in check_dump_stat)"); return -1; } else if (rsz == 0) { --- 659,663 ---- if ((rsz = read(fd, dcache->buf, dcache->buf_sz)) < 0) { ! perror("read dump(in check_dump_cond)"); return -1; } else if (rsz == 0) { |