Page MenuHomeFreeBSD

D60148.id188130.diff
No OneTemporary

D60148.id188130.diff

diff --git a/usr.bin/mkimg/image.c b/usr.bin/mkimg/image.c
--- a/usr.bin/mkimg/image.c
+++ b/usr.bin/mkimg/image.c
@@ -330,10 +330,11 @@
}
static int
-image_file_unmap(void *buffer, size_t sz)
+image_file_unmap(void *buffer, size_t sz, off_t iof)
{
size_t unit;
+ sz += iof;
unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz;
sz = (sz + unit - 1) & ~(unit - 1);
if (madvise(buffer, sz, MADV_DONTNEED) != 0)
@@ -381,7 +382,7 @@
error = errno;
else
error = 0;
- image_file_unmap(buffer, iosz);
+ image_file_unmap(buffer, iosz, iof);
/* XXX should we relinguish unused swap space? */
if (error)
return (error);
@@ -465,7 +466,7 @@
buf += iof;
error = image_chunk_copyin(blk, buf,
sz, data, fd);
- image_file_unmap(mp, sz);
+ image_file_unmap(mp, sz, iof);
} else
error = errno;
@@ -590,7 +591,7 @@
return (errno);
buf += iof;
error = image_copyout_memory(fd, sz, buf);
- image_file_unmap(mp, sz);
+ image_file_unmap(mp, sz, iof);
if (error)
return (error);
size -= sz;

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 1, 12:49 AM (2 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39971699
Default Alt Text
D60148.id188130.diff (1 KB)

Event Timeline