Simplify eli_is_attached() function and make it return boot instead of int.
MFC after: 3 days
This commit is contained in:
parent
34c4866250
commit
c99a654256
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226717
@ -333,11 +333,10 @@ arc4rand(unsigned char *buf, size_t size)
|
|||||||
buf[i] = arc4random() % 0xff;
|
buf[i] = arc4random() % 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static bool
|
||||||
eli_is_attached(const char *prov)
|
eli_is_attached(const char *prov)
|
||||||
{
|
{
|
||||||
char name[MAXPATHLEN];
|
char name[MAXPATHLEN];
|
||||||
unsigned secsize;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Not the best way to do it, but the easiest.
|
* 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.
|
* by asking about its sectorsize.
|
||||||
*/
|
*/
|
||||||
snprintf(name, sizeof(name), "%s%s", prov, G_ELI_SUFFIX);
|
snprintf(name, sizeof(name), "%s%s", prov, G_ELI_SUFFIX);
|
||||||
secsize = g_get_sectorsize(name);
|
return (g_get_sectorsize(name) > 0);
|
||||||
if (secsize > 0)
|
|
||||||
return (1);
|
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user