From 0f81d0941a2705d49bc129f69924265fa60d9677 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Thu, 21 May 2009 16:17:38 +0100 Subject: Add e2fsck_f command, and modify lvresize test to use it (RHBZ 502018). --- daemon/ext2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'daemon/ext2.c') diff --git a/daemon/ext2.c b/daemon/ext2.c index 639ae5dd..ab03528f 100644 --- a/daemon/ext2.c +++ b/daemon/ext2.c @@ -253,3 +253,22 @@ do_resize2fs (const char *device) free (err); return 0; } + +int +do_e2fsck_f (const char *device) +{ + char *err; + int r; + + IS_DEVICE (device, -1); + + r = command (NULL, &err, "/sbin/e2fsck", "-p", "-f", device, NULL); + if (r == -1) { + reply_with_error ("e2fsck: %s", err); + free (err); + return -1; + } + + free (err); + return 0; +} -- cgit