summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-06-16 14:36:40 +0000
committerbde <bde@FreeBSD.org>1998-06-16 14:36:40 +0000
commit58834da70ea1dcfb2ee4b41c80350be02ce47d44 (patch)
tree7b3b7b5bb44c5d63bf0e6255ffb8717074b9d46f /sys
parent0fd89b46c5dcd51783f4e969a4497365c32461ef (diff)
downloadFreeBSD-src-58834da70ea1dcfb2ee4b41c80350be02ce47d44.zip
FreeBSD-src-58834da70ea1dcfb2ee4b41c80350be02ce47d44.tar.gz
Use copyout() instead of bcopy() to copy the image to user space.
bcopy() caused panics under heavy paging (not quite as suspected - the kernel stack seemed to get corrupted). Fixed long lines. Reviewed by: phk
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/imgact_gzip.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c
index aabbdc9..3c9b6a4 100644
--- a/sys/kern/imgact_gzip.c
+++ b/sys/kern/imgact_gzip.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: imgact_gzip.c,v 1.31 1997/09/02 20:05:34 bde Exp $
+ * $Id: imgact_gzip.c,v 1.32 1997/12/14 19:36:24 jdp Exp $
*
* This module handles execution of a.out files which have been run through
* "gzip". This saves diskspace, but wastes cpu-cycles and VM.
@@ -341,12 +341,13 @@ Flush(void *vp, u_char * ptr, u_long siz)
}
if (gz->file_offset == 0) {
q = (u_char *) gz->virtual_offset;
- bcopy(&gz->a_out, q, sizeof gz->a_out);
+ copyout(&gz->a_out, q, sizeof gz->a_out);
}
}
}
/* Skip over zero-padded first PAGE if needed */
- if (gz->output < gz->file_offset && (gz->output + siz) > gz->file_offset) {
+ if (gz->output < gz->file_offset &&
+ gz->output + siz > gz->file_offset) {
i = min(siz, gz->file_offset - gz->output);
gz->output += i;
p += i;
@@ -354,8 +355,9 @@ Flush(void *vp, u_char * ptr, u_long siz)
}
if (gz->output >= gz->file_offset && gz->output < gz->file_end) {
i = min(siz, gz->file_end - gz->output);
- q = (u_char *) gz->virtual_offset + gz->output - gz->file_offset;
- bcopy(p, q, i);
+ q = (u_char *) gz->virtual_offset +
+ gz->output - gz->file_offset;
+ copyout(p, q, i);
gz->output += i;
p += i;
siz -= i;
OpenPOWER on IntegriCloud