From: Richard W.M. Jones Date: Thu, 14 Jul 2011 10:27:24 +0000 (+0100) Subject: mkfs: Don't die if mke2fs is not available. X-Git-Tag: 1.8.10~14 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=3effae351de6363c86027e69b5f0c89cd79b431a;p=libguestfs.git mkfs: Don't die if mke2fs is not available. Allow other types of filesystems to be created. (cherry picked from commit c6340f45007b0ab7e1c5391cf78afc10a816553f) --- diff --git a/daemon/mkfs.c b/daemon/mkfs.c index fa03afe..8bb7341 100644 --- a/daemon/mkfs.c +++ b/daemon/mkfs.c @@ -40,18 +40,18 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize) char blocksize_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";