aboutsummaryrefslogtreecommitdiff
path: root/lib/libgeom
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2017-04-23 01:47:51 +0000
committerEnji Cooper <ngie@FreeBSD.org>2017-04-23 01:47:51 +0000
commit2cebfa7bbfa1423b42fda06c52c3f535a4c432c8 (patch)
tree981c6634cd605d0ca88ef05f5f90633e49d56eed /lib/libgeom
parentae0cf296c938ca56dcc3c269d9f6a3f38b2f0b47 (diff)
downloadsrc-2cebfa7bbfa1423b42fda06c52c3f535a4c432c8.tar.gz
src-2cebfa7bbfa1423b42fda06c52c3f535a4c432c8.zip
Notes
Diffstat (limited to 'lib/libgeom')
-rw-r--r--lib/libgeom/geom_stats.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libgeom/geom_stats.c b/lib/libgeom/geom_stats.c
index 539c3202a521..82a63d020e18 100644
--- a/lib/libgeom/geom_stats.c
+++ b/lib/libgeom/geom_stats.c
@@ -87,6 +87,8 @@ geom_stats_open(void)
if (statsfd < 0)
return (errno);
pagesize = getpagesize();
+ if (pagesize == -1)
+ return (errno);
spp = pagesize / sizeof(struct devstat);
p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0);
if (p == MAP_FAILED) {