summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--helper/ext2.c10
2 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index a75a581..23c876b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,6 +105,7 @@ old_LIBS="$LIBS"
AC_CHECK_LIB([ext2fs],[ext2fs_file_open2],[],[
AC_MSG_FAILURE([libext2fs library not found (part of e2fsprogs)])
])
+AC_CHECK_FUNCS([ext2fs_close2])
LIBS="$old_LIBS"
AC_CHECK_HEADER([ext2fs/ext2fs.h],[],[
diff --git a/helper/ext2.c b/helper/ext2.c
index 2395871..56ad5e5 100644
--- a/helper/ext2.c
+++ b/helper/ext2.c
@@ -107,8 +107,16 @@ ext2_start (const char *hostcpu, const char *appliance,
static void
ext2_end (void)
{
+ if (verbose)
+ print_timestamped_message ("closing ext2 filesystem");
+
/* Write out changes and close. */
- errcode_t err = ext2fs_close (fs);
+ errcode_t err;
+#ifdef HAVE_EXT2FS_CLOSE2
+ err = ext2fs_close2 (fs, EXT2_FLAG_FLUSH_NO_SYNC);
+#else
+ err = ext2fs_close (fs);
+#endif
if (err != 0)
error (EXIT_FAILURE, 0, "ext2fs_close: %s", error_message (err));
}