From: David van Moolenbroek Date: Sat, 27 Feb 2016 17:45:02 +0000 (+0000) Subject: libc: fix local from-source upgrades X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=84ed480ef770e26a28565a26c8ef94ba01312a41;p=minix.git libc: fix local from-source upgrades Commit git-c38dbb9 inadvertently broke local MINIX3-on-MINIX3 builds, since its libc changes relied on VFS being upgraded already as well. As a result, after installing the new libc, networking ceased to work, leading to curl(1) failing later on in the build process. This patch introduces transitional code that is necessary for the build process to complete, after which it is obsolete again. Change-Id: I93bf29c01d228e3d7efc7b01befeff682954f54d --- diff --git a/minix/lib/libc/sys/accept.c b/minix/lib/libc/sys/accept.c index 6207f233a..e1eeed821 100644 --- a/minix/lib/libc/sys/accept.c +++ b/minix/lib/libc/sys/accept.c @@ -60,7 +60,7 @@ int accept(int sock, struct sockaddr *__restrict address, nwio_udpopt_t udpopt; r = __accept(sock, address, address_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= _tcp_accept(sock, address, address_len); diff --git a/minix/lib/libc/sys/bind.c b/minix/lib/libc/sys/bind.c index ddefa6ad1..d7c9a7495 100644 --- a/minix/lib/libc/sys/bind.c +++ b/minix/lib/libc/sys/bind.c @@ -58,7 +58,7 @@ int bind(int sock, const struct sockaddr *address, socklen_t address_len) struct sockaddr_un uds_addr; r = __bind(sock, address, address_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= ioctl(sock, NWIOGTCPCONF, &tcpconf); diff --git a/minix/lib/libc/sys/connect.c b/minix/lib/libc/sys/connect.c index be494845f..9d542beb4 100644 --- a/minix/lib/libc/sys/connect.c +++ b/minix/lib/libc/sys/connect.c @@ -57,7 +57,7 @@ int connect(int sock, const struct sockaddr *address, nwio_udpopt_t udpopt; r = __connect(sock, address, address_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= ioctl(sock, NWIOGTCPCONF, &tcpconf); diff --git a/minix/lib/libc/sys/getpeername.c b/minix/lib/libc/sys/getpeername.c index f79303406..975e3a924 100644 --- a/minix/lib/libc/sys/getpeername.c +++ b/minix/lib/libc/sys/getpeername.c @@ -60,7 +60,7 @@ int getpeername(int sock, struct sockaddr *__restrict address, struct sockaddr_un uds_addr; r = __getpeername(sock, address, address_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= ioctl(sock, NWIOGTCPCONF, &tcpconf); diff --git a/minix/lib/libc/sys/getsockname.c b/minix/lib/libc/sys/getsockname.c index e021185fe..23b1de92f 100644 --- a/minix/lib/libc/sys/getsockname.c +++ b/minix/lib/libc/sys/getsockname.c @@ -62,7 +62,7 @@ int getsockname(int fd, struct sockaddr *__restrict address, struct sockaddr_un uds_addr; r = __getsockname(fd, address, address_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; #if DEBUG diff --git a/minix/lib/libc/sys/getsockopt.c b/minix/lib/libc/sys/getsockopt.c index 7a1d1cf50..7edea530e 100644 --- a/minix/lib/libc/sys/getsockopt.c +++ b/minix/lib/libc/sys/getsockopt.c @@ -68,7 +68,7 @@ int getsockopt(int sock, int level, int option_name, struct sockaddr_un uds_addr; r = __getsockopt(sock, level, option_name, option_value, option_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= ioctl(sock, NWIOGTCPOPT, &tcpopt); diff --git a/minix/lib/libc/sys/listen.c b/minix/lib/libc/sys/listen.c index d0ac51439..a2522af90 100644 --- a/minix/lib/libc/sys/listen.c +++ b/minix/lib/libc/sys/listen.c @@ -35,7 +35,7 @@ int listen(int sock, int backlog) int r; r = __listen(sock, backlog); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= ioctl(sock, NWIOTCPLISTENQ, &backlog); diff --git a/minix/lib/libc/sys/recvfrom.c b/minix/lib/libc/sys/recvfrom.c index f04c627e6..47f508486 100644 --- a/minix/lib/libc/sys/recvfrom.c +++ b/minix/lib/libc/sys/recvfrom.c @@ -81,7 +81,7 @@ ssize_t recvfrom(int sock, void *__restrict buffer, size_t length, int uds_sotype = -1; r = __recvfrom(sock, buffer, length, flags, address, address_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; #if DEBUG diff --git a/minix/lib/libc/sys/recvmsg.c b/minix/lib/libc/sys/recvmsg.c index 18ea01cf2..d8c32e504 100644 --- a/minix/lib/libc/sys/recvmsg.c +++ b/minix/lib/libc/sys/recvmsg.c @@ -90,7 +90,7 @@ ssize_t recvmsg(int sock, struct msghdr *msg, int flags) int uds_sotype; r = __recvmsg(sock, msg, flags); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; if (msg == NULL) { diff --git a/minix/lib/libc/sys/sendmsg.c b/minix/lib/libc/sys/sendmsg.c index abfdfec47..4d4452cff 100644 --- a/minix/lib/libc/sys/sendmsg.c +++ b/minix/lib/libc/sys/sendmsg.c @@ -88,7 +88,7 @@ ssize_t sendmsg(int sock, const struct msghdr *msg, int flags) int uds_sotype; r = __sendmsg(sock, msg, flags); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; if (msg == NULL) { diff --git a/minix/lib/libc/sys/sendto.c b/minix/lib/libc/sys/sendto.c index ff83d8f7e..77304f301 100644 --- a/minix/lib/libc/sys/sendto.c +++ b/minix/lib/libc/sys/sendto.c @@ -63,7 +63,7 @@ ssize_t sendto(int sock, const void *message, size_t length, int flags, int uds_sotype = -1; r = __sendto(sock, message, length, flags, dest_addr, dest_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= ioctl(sock, NWIOGTCPOPT, &tcpopt); diff --git a/minix/lib/libc/sys/setsockopt.c b/minix/lib/libc/sys/setsockopt.c index 8ab1dcac8..04c0d311d 100644 --- a/minix/lib/libc/sys/setsockopt.c +++ b/minix/lib/libc/sys/setsockopt.c @@ -56,7 +56,7 @@ int setsockopt(int sock, int level, int option_name, struct sockaddr_un uds_addr; r = __setsockopt(sock, level, option_name, option_value, option_len); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= ioctl(sock, NWIOGTCPOPT, &tcpopt); diff --git a/minix/lib/libc/sys/shutdown.c b/minix/lib/libc/sys/shutdown.c index f0839f486..e2eaf8384 100644 --- a/minix/lib/libc/sys/shutdown.c +++ b/minix/lib/libc/sys/shutdown.c @@ -40,7 +40,7 @@ int shutdown(int sock, int how) nwio_tcpconf_t tcpconf; r = __shutdown(sock, how); - if (r != -1 || errno != ENOTSOCK) + if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS)) return r; r= ioctl(sock, NWIOGTCPCONF, &tcpconf); diff --git a/minix/lib/libc/sys/socket.c b/minix/lib/libc/sys/socket.c index e07f4ba13..ce2352a2b 100644 --- a/minix/lib/libc/sys/socket.c +++ b/minix/lib/libc/sys/socket.c @@ -60,7 +60,7 @@ int socket(int domain, int type, int protocol) int r, sock_type; r = __socket(domain, type, protocol); - if (r != -1 || errno != EAFNOSUPPORT) + if (r != -1 || (errno != EAFNOSUPPORT && errno != ENOSYS)) return r; sock_type = type & ~SOCK_FLAGS_MASK; diff --git a/minix/lib/libc/sys/socketpair.c b/minix/lib/libc/sys/socketpair.c index 5f4a84460..1b1767dcd 100644 --- a/minix/lib/libc/sys/socketpair.c +++ b/minix/lib/libc/sys/socketpair.c @@ -45,7 +45,7 @@ socketpair(int domain, int type, int protocol, int sv[2]) int r; r = __socketpair(domain, type, protocol, sv); - if (r != -1 || errno != EAFNOSUPPORT) + if (r != -1 || (errno != EAFNOSUPPORT && errno != ENOSYS)) return r; #if DEBUG