diff options
author | Richard Jones <rjones@redhat.com> | 2009-05-21 16:17:38 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-05-21 16:17:38 +0100 |
commit | 0f81d0941a2705d49bc129f69924265fa60d9677 (patch) | |
tree | 45abfd6c73660ff293f8a5efb4eb54521be1c73d /daemon/ext2.c | |
parent | 2a042d9844ca203ccea28a5d533c18f2dbdfcfa7 (diff) | |
download | libguestfs-0f81d0941a2705d49bc129f69924265fa60d9677.tar.gz libguestfs-0f81d0941a2705d49bc129f69924265fa60d9677.tar.xz libguestfs-0f81d0941a2705d49bc129f69924265fa60d9677.zip |
Add e2fsck_f command, and modify lvresize test to use it (RHBZ 502018).
Diffstat (limited to 'daemon/ext2.c')
-rw-r--r-- | daemon/ext2.c | 19 |
1 files changed, 19 insertions, 0 deletions
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; +} |