summaryrefslogtreecommitdiffstats
path: root/sbin/geom/class/eli
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-10-25 07:32:43 +0000
committerpjd <pjd@FreeBSD.org>2011-10-25 07:32:43 +0000
commit81eb88852fb341049497ac8499e2b751ef8cce4d (patch)
tree5f4386542f53f714024863ac3236c162109ff967 /sbin/geom/class/eli
parent38c5d5e6a3b5f85d473b1c513e7210a63b577191 (diff)
downloadFreeBSD-src-81eb88852fb341049497ac8499e2b751ef8cce4d.zip
FreeBSD-src-81eb88852fb341049497ac8499e2b751ef8cce4d.tar.gz
Simplify eli_is_attached() function and make it return boot instead of int.
MFC after: 3 days
Diffstat (limited to 'sbin/geom/class/eli')
-rw-r--r--sbin/geom/class/eli/geom_eli.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sbin/geom/class/eli/geom_eli.c b/sbin/geom/class/eli/geom_eli.c
index 975afda..3f136e1 100644
--- a/sbin/geom/class/eli/geom_eli.c
+++ b/sbin/geom/class/eli/geom_eli.c
@@ -333,11 +333,10 @@ arc4rand(unsigned char *buf, size_t size)
buf[i] = arc4random() % 0xff;
}
-static int
+static bool
eli_is_attached(const char *prov)
{
char name[MAXPATHLEN];
- unsigned secsize;
/*
* Not the best way to do it, but the easiest.
@@ -345,10 +344,7 @@ eli_is_attached(const char *prov)
* by asking about its sectorsize.
*/
snprintf(name, sizeof(name), "%s%s", prov, G_ELI_SUFFIX);
- secsize = g_get_sectorsize(name);
- if (secsize > 0)
- return (1);
- return (0);
+ return (g_get_sectorsize(name) > 0);
}
static int
OpenPOWER on IntegriCloud