source: MondoRescue/branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/ext2fs/write_bb_file.c@ 3320

Last change on this file since 3320 was 3320, checked in by Bruno Cornec, 9 years ago
  • Re-add (thanks git BTW) the 2.2.9 branch which had been destroyed in the move to 3.0
  • Property svn:eol-style set to native
File size: 757 bytes
Line 
1/* vi: set sw=4 ts=4: */
2/*
3 * write_bb_file.c --- write a list of bad blocks to a FILE *
4 *
5 * Copyright (C) 1994, 1995 Theodore Ts'o.
6 *
7 * %Begin-Header%
8 * This file may be redistributed under the terms of the GNU Public
9 * License.
10 * %End-Header%
11 */
12
13#include <stdio.h>
14
15#include "ext2_fs.h"
16#include "ext2fs.h"
17
18errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list,
19 unsigned int flags EXT2FS_ATTR((unused)),
20 FILE *f)
21{
22 badblocks_iterate bb_iter;
23 blk_t blk;
24 errcode_t retval;
25
26 retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
27 if (retval)
28 return retval;
29
30 while (ext2fs_badblocks_list_iterate(bb_iter, &blk)) {
31 fprintf(f, "%d\n", blk);
32 }
33 ext2fs_badblocks_list_iterate_end(bb_iter);
34 return 0;
35}
Note: See TracBrowser for help on using the repository browser.