* list. (Work done by David Beattie)
*/
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* for O_DIRECT */
+#endif
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
+#include "config.h"
#include <errno.h>
#include <fcntl.h>
#ifdef HAVE_GETOPT_H
try = blocks_at_once;
currently_testing = first_block;
num_blocks = last_block - 1;
- if (!t_flag && (s_flag || v_flag)) {
+ if (!t_flag && (s_flag || v_flag))
fputs(_("Checking for bad blocks (read-only test): "), stderr);
- if (v_flag <= 1)
- alarm_intr(SIGALRM);
- }
+ if (s_flag && v_flag <= 1)
+ alarm_intr(SIGALRM);
while (currently_testing < last_block)
{
if (max_bb && bb_count >= max_bb) {
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;
setlocale(LC_CTYPE, "");
bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
textdomain(NLS_CAT_NAME);
+ set_com_err_gettext(gettext);
#endif
srandom((unsigned int)time(NULL)); /* simple randomness is enough */
test_func = test_ro;
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) {