summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/strsubr.c
diff options
context:
space:
mode:
authorgd78059 <none@none>2008-06-27 14:06:49 -0700
committergd78059 <none@none>2008-06-27 14:06:49 -0700
commit8aa5c3092bce9155bf46c01a22270bfe4b0382cb (patch)
tree2687d7db84eaaa27ec1eba9e2136b9071b015c09 /usr/src/uts/common/os/strsubr.c
parent1ee144f52d4da36525fa33b932021e610ab2caf8 (diff)
downloadillumos-joyent-8aa5c3092bce9155bf46c01a22270bfe4b0382cb.tar.gz
PSARC 2008/367 Remove MAXIOCBSZ
6711691 Remove MAXIOCBSZ logic
Diffstat (limited to 'usr/src/uts/common/os/strsubr.c')
-rw-r--r--usr/src/uts/common/os/strsubr.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/usr/src/uts/common/os/strsubr.c b/usr/src/uts/common/os/strsubr.c
index a7750e2ec3..cd8a0a2a62 100644
--- a/usr/src/uts/common/os/strsubr.c
+++ b/usr/src/uts/common/os/strsubr.c
@@ -1450,7 +1450,6 @@ putiocd(mblk_t *bp, char *arg, int flag, cred_t *cr)
{
mblk_t *tmp;
ssize_t count;
- size_t n;
int error = 0;
ASSERT((flag & (U_TO_K | K_TO_K)) == U_TO_K ||
@@ -1468,23 +1467,18 @@ putiocd(mblk_t *bp, char *arg, int flag, cred_t *cr)
*/
ASSERT(count >= 0);
- while (count > 0) {
- n = MIN(MAXIOCBSZ, count);
- if ((tmp = allocb_cred_wait(n, (flag & STR_NOSIG), &error,
- cr)) == NULL) {
- return (error);
- }
- error = strcopyin(arg, tmp->b_wptr, n, flag & (U_TO_K|K_TO_K));
- if (error != 0) {
- freeb(tmp);
- return (error);
- }
- arg += n;
- DB_CPID(tmp) = curproc->p_pid;
- tmp->b_wptr += n;
- count -= n;
- bp = (bp->b_cont = tmp);
+ if ((tmp = allocb_cred_wait(count, (flag & STR_NOSIG), &error, cr)) ==
+ NULL) {
+ return (error);
+ }
+ error = strcopyin(arg, tmp->b_wptr, count, flag & (U_TO_K|K_TO_K));
+ if (error != 0) {
+ freeb(tmp);
+ return (error);
}
+ DB_CPID(tmp) = curproc->p_pid;
+ tmp->b_wptr += count;
+ bp->b_cont = tmp;
return (0);
}