diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-07-14 11:27:24 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-07-14 11:28:05 +0100 |
commit | c6340f45007b0ab7e1c5391cf78afc10a816553f (patch) | |
tree | 77aadc377586e542f52d52f4dc9963748b8a64bf /daemon | |
parent | c21d6dc29c91691f2dcd914d0cc85f060f83289c (diff) | |
download | libguestfs-c6340f45007b0ab7e1c5391cf78afc10a816553f.tar.gz libguestfs-c6340f45007b0ab7e1c5391cf78afc10a816553f.tar.xz libguestfs-c6340f45007b0ab7e1c5391cf78afc10a816553f.zip |
mkfs: Don't die if mke2fs is not available.
Allow other types of filesystems to be created.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/mkfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/daemon/mkfs.c b/daemon/mkfs.c index 353d8fac..fc798c45 100644 --- a/daemon/mkfs.c +++ b/daemon/mkfs.c @@ -43,18 +43,18 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize, char sectorsize_str[32]; int r; char *err; - char mke2fs[] = "mke2fs"; - if (e2prog (mke2fs) == -1) - return -1; /* For ext2/3/4 run the mke2fs program directly. This is because * the mkfs program "eats" some options, in particular the -F * option. */ if (STREQ (fstype, "ext2") || STREQ (fstype, "ext3") || - STREQ (fstype, "ext4")) + STREQ (fstype, "ext4")) { + if (e2prog (mke2fs) == -1) + return -1; argv[i++] = mke2fs; + } else argv[i++] = "mkfs"; |