Deleted Added
full compact
proto_socketpair.c (219873) proto_socketpair.c (229945)
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Pawel Jakub Dawidek under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Pawel Jakub Dawidek under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sbin/hastd/proto_socketpair.c 219873 2011-03-22 16:21:11Z pjd $");
31__FBSDID("$FreeBSD: head/sbin/hastd/proto_socketpair.c 229945 2012-01-10 22:39:07Z pjd $");
32
33#include <sys/types.h>
34#include <sys/socket.h>
35
36#include <errno.h>
37#include <stdbool.h>
38#include <stdint.h>
39#include <stdio.h>

--- 25 unchanged lines hidden (view full) ---

65 return (-1);
66
67 PJDLOG_ASSERT(srcaddr == NULL);
68
69 spctx = malloc(sizeof(*spctx));
70 if (spctx == NULL)
71 return (errno);
72
32
33#include <sys/types.h>
34#include <sys/socket.h>
35
36#include <errno.h>
37#include <stdbool.h>
38#include <stdint.h>
39#include <stdio.h>

--- 25 unchanged lines hidden (view full) ---

65 return (-1);
66
67 PJDLOG_ASSERT(srcaddr == NULL);
68
69 spctx = malloc(sizeof(*spctx));
70 if (spctx == NULL)
71 return (errno);
72
73 if (socketpair(PF_UNIX, SOCK_STREAM, 0, spctx->sp_fd) < 0) {
73 if (socketpair(PF_UNIX, SOCK_STREAM, 0, spctx->sp_fd) == -1) {
74 ret = errno;
75 free(spctx);
76 return (ret);
77 }
78
79 spctx->sp_side = SP_SIDE_UNDEF;
80 spctx->sp_magic = SP_CTX_MAGIC;
81 *ctxp = spctx;

--- 156 unchanged lines hidden ---
74 ret = errno;
75 free(spctx);
76 return (ret);
77 }
78
79 spctx->sp_side = SP_SIDE_UNDEF;
80 spctx->sp_magic = SP_CTX_MAGIC;
81 *ctxp = spctx;

--- 156 unchanged lines hidden ---