From b0496023a1ed12c70693d74ca6c1620a14fe5840 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 25 Jun 2017 23:12:59 +0200 Subject: [PATCH] Allow AF_UNSPEC family in socketpair(2). --- libc/sys/socket/socketpair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/sys/socket/socketpair.c b/libc/sys/socket/socketpair.c index 95553a91..a476c3f0 100644 --- a/libc/sys/socket/socketpair.c +++ b/libc/sys/socket/socketpair.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Jonas 'Sortie' Termansen. + * Copyright (c) 2016, 2017 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -131,7 +131,7 @@ static int socketpair_unix_stream(int flags, int fds[2]) int socketpair(int family, int type, int protocol, int fds[2]) { - if ( family == AF_UNIX ) + if ( family == AF_UNSPEC || family == AF_UNIX ) { if ( protocol != 0 ) return errno = EPROTONOSUPPORT, -1;