summaryrefslogtreecommitdiffstats
path: root/helper
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-11-06 10:22:41 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-11-06 10:29:30 +0000
commitf6ca1f0328b16824b5239f026d82c598401f0ab7 (patch)
tree1f73e1b39634350c2ef9aff7aace4ea6b7dc2f01 /helper
parente6fb84221e0ca39858f8e09e289c52b5c07d4ddf (diff)
downloadfebootstrap-f6ca1f0328b16824b5239f026d82c598401f0ab7.tar.gz
febootstrap-f6ca1f0328b16824b5239f026d82c598401f0ab7.tar.xz
febootstrap-f6ca1f0328b16824b5239f026d82c598401f0ab7.zip
RHEL 5: Don't pass BLOCK_FLAG_READ_ONLY to ext2_block_iterate if not defined.
Diffstat (limited to 'helper')
-rw-r--r--helper/ext2.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/helper/ext2.c b/helper/ext2.c
index a27fb47..7ad120b 100644
--- a/helper/ext2.c
+++ b/helper/ext2.c
@@ -304,9 +304,19 @@ ext2_clean_path (ext2_ino_t dir_ino,
if (err != 0)
error (EXIT_FAILURE, 0, "ext2fs_write_inode: %s", error_message (err));
- if (ext2fs_inode_has_valid_blocks (&inode))
- ext2fs_block_iterate (fs, ino, BLOCK_FLAG_READ_ONLY, NULL,
+ if (ext2fs_inode_has_valid_blocks (&inode)) {
+ int flags = 0;
+ /* From the docs: "BLOCK_FLAG_READ_ONLY is a promise by the
+ * caller that it will not modify returned block number."
+ * RHEL 5 does not have this flag, so just omit it if it is
+ * not defined.
+ */
+#ifdef BLOCK_FLAG_READ_ONLY
+ flags |= BLOCK_FLAG_READ_ONLY;
+#endif
+ ext2fs_block_iterate (fs, ino, flags, NULL,
release_block, NULL);
+ }
ext2fs_inode_alloc_stats2 (fs, ino, -1, isdir);
}