Date: Tue, 25 Oct 2011 07:32:43 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r226717 - head/sbin/geom/class/eli Message-ID: <201110250732.p9P7Whjo084297@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Tue Oct 25 07:32:43 2011 New Revision: 226717 URL: http://svn.freebsd.org/changeset/base/226717 Log: Simplify eli_is_attached() function and make it return boot instead of int. MFC after: 3 days Modified: head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Tue Oct 25 07:31:13 2011 (r226716) +++ head/sbin/geom/class/eli/geom_eli.c Tue Oct 25 07:32:43 2011 (r226717) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110250732.p9P7Whjo084297>