Whamcloud - gitweb
mke2fs: clean up error handling in mke2fs_setup_tdb()
[tools/e2fsprogs.git] / misc / badblocks.c
index 3e7b336..549a339 100644 (file)
@@ -203,6 +203,9 @@ static void print_status(void)
                       calc_percent((unsigned long) currently_testing,
                                    (unsigned long) num_blocks), 
                       time_diff_format(&time_end, &time_start, diff_buf));
+#ifdef HAVE_MBSTOWCS
+       len = mbstowcs(NULL, line_buf, sizeof(line_buf));
+#endif
        fputs(line_buf, stderr);
        memset(line_buf, '\b', len);
        line_buf[len] = 0;
@@ -223,6 +226,7 @@ static void *terminate_addr = NULL;
 
 static void terminate_intr(int signo EXT2FS_ATTR((unused)))
 {
+       fflush(out);
        fprintf(stderr, "\n\nInterrupted at block %llu\n", 
                (unsigned long long) currently_testing);
        fflush(stderr);
@@ -980,7 +984,7 @@ int main (int argc, char ** argv)
        FILE * in = NULL;
        int block_size = 1024;
        unsigned int blocks_at_once = 64;
-       blk_t last_block, first_block;
+       blk64_t last_block, first_block;
        int num_passes = 0;
        int passes_clean = 0;
        int dev;
@@ -1115,7 +1119,7 @@ int main (int argc, char ** argv)
                usage();
        device_name = argv[optind++];
        if (optind > argc - 1) {
-               errcode = ext2fs_get_device_size(device_name,
+               errcode = ext2fs_get_device_size2(device_name,
                                                 block_size,
                                                 &last_block);
                if (errcode == EXT2_ET_UNIMPLEMENTED) {