~ubuntu-branches/debian/jessie/arcboot/jessie

« back to all changes in this revision

Viewing changes to e2fslib/write_bb_file.c

  • Committer: Bazaar Package Importer
  • Author(s): Guido Guenther
  • Date: 2004-03-02 12:01:14 UTC
  • Revision ID: james.westby@ubuntu.com-20040302120114-0pukal9hlpt3k0l7
Tags: 0.3.8.1
correct subarch detection for IP32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * write_bb_file.c --- write a list of bad blocks to a FILE *
 
3
 *
 
4
 * Copyright (C) 1994, 1995 Theodore Ts'o.
 
5
 *
 
6
 * %Begin-Header%
 
7
 * This file may be redistributed under the terms of the GNU Public
 
8
 * License.
 
9
 * %End-Header%
 
10
 */
 
11
 
 
12
#include <stdio.h>
 
13
 
 
14
#include "ext2_fs.h"
 
15
#include "ext2fs.h"
 
16
 
 
17
errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list,
 
18
                               unsigned int flags,
 
19
                               FILE *f)
 
20
{
 
21
        badblocks_iterate       bb_iter;
 
22
        blk_t                   blk;
 
23
        errcode_t               retval;
 
24
 
 
25
        retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
 
26
        if (retval)
 
27
                return retval;
 
28
 
 
29
        while (ext2fs_badblocks_list_iterate(bb_iter, &blk)) {
 
30
                fprintf(f, "%d\n", blk);
 
31
        }
 
32
        ext2fs_badblocks_list_iterate_end(bb_iter);
 
33
        return 0;
 
34
}