summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2007-10-19 14:38:45 +0000
committerpooka <pooka@NetBSD.org>2007-10-19 14:38:45 +0000
commitcf6e3aa4f9041b1fb331e0197be6285948e239da (patch)
treebb5346d3e480c15f17f78dc0fb5f9543bf638078 /lib
parent4f0f9d66adf1b5e4381ad71b0e9b362191a93d4f (diff)
When doing a read operation, don't copy the whole kernel buffer to
userspace, since it doesn't contain any information yet. I should still rework this more so this is just a quickie to get the read/write style interface more up to speed with the ioctl version.
Diffstat (limited to 'lib')
-rw-r--r--lib/libpuffs/requests.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libpuffs/requests.c b/lib/libpuffs/requests.c
index f6461c09a3d..c808aa29c17 100644
--- a/lib/libpuffs/requests.c
+++ b/lib/libpuffs/requests.c
@@ -1,4 +1,4 @@
-/* $NetBSD: requests.c,v 1.10 2007/10/11 19:41:15 pooka Exp $ */
+/* $NetBSD: requests.c,v 1.11 2007/10/19 14:38:45 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: requests.c,v 1.10 2007/10/11 19:41:15 pooka Exp $");
+__RCSID("$NetBSD: requests.c,v 1.11 2007/10/19 14:38:45 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -78,7 +78,7 @@ puffs_req_loadget(struct puffs_getreq *pgr)
return 0;
return -1;
}
- buf = malloc(pfr.pfr_len);
+ buf = malloc(pfr.pfr_alloclen);
assert(buf != NULL); /* XXX: a bit more grace here, thanks */
memcpy(buf, &pfr, sizeof(pfr));
@@ -148,6 +148,7 @@ puffs_req_put(struct puffs_putreq *ppr, struct puffs_req *preq)
{
ssize_t n;
+ preq->preq_frhdr.pfr_len = preq->preq_buflen;
n = write(ppr->ppr_pu->pu_fd, preq, preq->preq_frhdr.pfr_len);
assert(n == preq->preq_frhdr.pfr_len);
free(preq);