uipc_usrreq.c (247667) | uipc_usrreq.c (247736) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. 4 * Copyright (c) 2004-2009 Robert N. M. Watson 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 43 unchanged lines hidden (view full) --- 52 * TODO: 53 * RDM 54 * distinguish datagram size limits from flow control limits in SEQPACKET 55 * rethink name space problems 56 * need a proper out-of-band 57 */ 58 59#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. 4 * Copyright (c) 2004-2009 Robert N. M. Watson 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 43 unchanged lines hidden (view full) --- 52 * TODO: 53 * RDM 54 * distinguish datagram size limits from flow control limits in SEQPACKET 55 * rethink name space problems 56 * need a proper out-of-band 57 */ 58 59#include <sys/cdefs.h> |
60__FBSDID("$FreeBSD: head/sys/kern/uipc_usrreq.c 247667 2013-03-02 21:11:30Z pjd $"); | 60__FBSDID("$FreeBSD: head/sys/kern/uipc_usrreq.c 247736 2013-03-03 23:23:35Z pjd $"); |
61 62#include "opt_ddb.h" 63 64#include <sys/param.h> 65#include <sys/capability.h> 66#include <sys/domain.h> 67#include <sys/fcntl.h> 68#include <sys/malloc.h> /* XXX must be before <sys/file.h> */ --- 1612 unchanged lines hidden (view full) --- 1681static void 1682unp_freerights(struct filedescent *fde, int fdcount) 1683{ 1684 struct file *fp; 1685 int i; 1686 1687 for (i = 0; i < fdcount; i++, fde++) { 1688 fp = fde->fde_file; | 61 62#include "opt_ddb.h" 63 64#include <sys/param.h> 65#include <sys/capability.h> 66#include <sys/domain.h> 67#include <sys/fcntl.h> 68#include <sys/malloc.h> /* XXX must be before <sys/file.h> */ --- 1612 unchanged lines hidden (view full) --- 1681static void 1682unp_freerights(struct filedescent *fde, int fdcount) 1683{ 1684 struct file *fp; 1685 int i; 1686 1687 for (i = 0; i < fdcount; i++, fde++) { 1688 fp = fde->fde_file; |
1689 filecaps_free(&fdep->fde_caps); |
|
1689 bzero(fde, sizeof(*fde)); 1690 unp_discard(fp); 1691 } 1692} 1693 1694static int 1695unp_externalize(struct mbuf *control, struct mbuf **controlp) 1696{ --- 58 unchanged lines hidden (view full) --- 1755 1756 fdp = (int *) 1757 CMSG_DATA(mtod(*controlp, struct cmsghdr *)); 1758 for (i = 0; i < newfds; i++, fdep++, fdp++) { 1759 if (fdalloc(td, 0, &f)) 1760 panic("unp_externalize fdalloc failed"); 1761 fde = &fdesc->fd_ofiles[f]; 1762 fde->fde_file = fdep->fde_file; | 1690 bzero(fde, sizeof(*fde)); 1691 unp_discard(fp); 1692 } 1693} 1694 1695static int 1696unp_externalize(struct mbuf *control, struct mbuf **controlp) 1697{ --- 58 unchanged lines hidden (view full) --- 1756 1757 fdp = (int *) 1758 CMSG_DATA(mtod(*controlp, struct cmsghdr *)); 1759 for (i = 0; i < newfds; i++, fdep++, fdp++) { 1760 if (fdalloc(td, 0, &f)) 1761 panic("unp_externalize fdalloc failed"); 1762 fde = &fdesc->fd_ofiles[f]; 1763 fde->fde_file = fdep->fde_file; |
1763 filecaps_copy(&fdep->fde_caps, &fde->fde_caps); | 1764 filecaps_move(&fdep->fde_caps, &fde->fde_caps); |
1764 unp_externalize_fp(fde->fde_file); 1765 *fdp = f; 1766 } 1767 FILEDESC_XUNLOCK(fdesc); 1768 } else { 1769 /* We can just copy anything else across. */ 1770 if (error || controlp == NULL) 1771 goto next; --- 718 unchanged lines hidden --- | 1765 unp_externalize_fp(fde->fde_file); 1766 *fdp = f; 1767 } 1768 FILEDESC_XUNLOCK(fdesc); 1769 } else { 1770 /* We can just copy anything else across. */ 1771 if (error || controlp == NULL) 1772 goto next; --- 718 unchanged lines hidden --- |