From 0c9206b091c4f8101f6687c1a53ca3618d2acfcd Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Mon, 3 Nov 2003 17:13:06 +0000 Subject: [PATCH] page_size -> PAGE_SIZE --- lib/partmap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/partmap.c b/lib/partmap.c index 756fdb63..d3892ff5 100644 --- a/lib/partmap.c +++ b/lib/partmap.c @@ -17,6 +17,7 @@ #include #include #include +#include struct partmap { int fd; @@ -32,14 +33,9 @@ struct partmap { #define PARTMAP_WINDOW 16777216 #endif -static uns page_size; - struct partmap * partmap_open(byte *name, int writeable) { - if (!page_size) - page_size = getpagesize(); - struct partmap *p = xmalloc_zero(sizeof(struct partmap)); p->fd = sh_open(name, writeable ? O_RDWR : O_RDONLY); @@ -76,7 +72,7 @@ partmap_map(struct partmap *p, sh_off_t start, uns size) uns win = PARTMAP_WINDOW; ASSERT(win >= size); sh_off_t end = start + size; - start = start/page_size * page_size; + start = start/PAGE_SIZE * PAGE_SIZE; if (start+win > p->file_size) win = p->file_size - start; if (start+win < end) -- 2.39.2