diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-19 23:15:00 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-19 23:15:00 +0000 |
commit | e1f0be736374f3c06973b65c156011295133092a (patch) | |
tree | 714cfb7e89aa91f5885ef5db6a4d7f6c4928380c /sys/kern | |
parent | 50413aeaaa85d005bb9c6cf3458c8285c9e30e3d (diff) |
Heh. Don't assume that sizeof(void *) > sizeof(int).
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 619cc8fcc64..9042a3f7644 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.19 2002/02/11 12:35:53 art Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.20 2002/02/19 23:14:59 art Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -678,10 +678,10 @@ restart: * First loop -- allocate file descriptor table slots for the * new descriptors. */ - rp = ((struct file **)CMSG_DATA(cm)) + nfds - 1; + rp = ((struct file **)CMSG_DATA(cm)); for (i = 0; i < nfds; i++) { bcopy(rp, &fp, sizeof(fp)); - rp--; + rp++; if ((error = fdalloc(p, 0, &fdp[i])) != 0) { /* * Back out what we've done so far. @@ -775,11 +775,11 @@ morespace: cm->cmsg_len = CMSG_LEN(nfds * sizeof(struct file *)); control->m_len = CMSG_SPACE(nfds * sizeof(struct file *)); - ip = ((int *)CMSG_DATA(cm)); + ip = ((int *)CMSG_DATA(cm)) + nfds - 1; rp = ((struct file **)CMSG_DATA(cm)) + nfds - 1; for (i = 0; i < nfds; i++) { bcopy(ip, &fd, sizeof fd); - ip++; + ip--; if ((fp = fd_getfile(fdp, fd)) == NULL) { error = EBADF; goto fail; |