common.c (214256) | common.c (221830) |
---|---|
1/*- 2 * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/lib/libfetch/common.c 214256 2010-10-24 01:05:10Z emaste $"); | 30__FBSDID("$FreeBSD: head/lib/libfetch/common.c 221830 2011-05-13 07:21:41Z des $"); |
31 32#include <sys/param.h> 33#include <sys/socket.h> 34#include <sys/time.h> 35#include <sys/uio.h> 36 37#include <netinet/in.h> 38 --- 169 unchanged lines hidden (view full) --- 208conn_t * 209fetch_reopen(int sd) 210{ 211 conn_t *conn; 212 213 /* allocate and fill connection structure */ 214 if ((conn = calloc(1, sizeof(*conn))) == NULL) 215 return (NULL); | 31 32#include <sys/param.h> 33#include <sys/socket.h> 34#include <sys/time.h> 35#include <sys/uio.h> 36 37#include <netinet/in.h> 38 --- 169 unchanged lines hidden (view full) --- 208conn_t * 209fetch_reopen(int sd) 210{ 211 conn_t *conn; 212 213 /* allocate and fill connection structure */ 214 if ((conn = calloc(1, sizeof(*conn))) == NULL) 215 return (NULL); |
216 fcntl(sd, F_SETFD, FD_CLOEXEC); |
|
216 conn->sd = sd; 217 ++conn->ref; 218 return (conn); 219} 220 221 222/* 223 * Bump a connection's reference count. --- 632 unchanged lines hidden --- | 217 conn->sd = sd; 218 ++conn->ref; 219 return (conn); 220} 221 222 223/* 224 * Bump a connection's reference count. --- 632 unchanged lines hidden --- |