From: Allan Stephens Date: Tue, 15 Apr 2008 07:16:19 +0000 (-0700) Subject: [TIPC]: Add error check to detect non-blocking form of connect() X-Git-Tag: v2.6.26-rc1~1138^2~81 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4934c69a384ede7d0c3009098184554da2063de6;p=linux-2.6-omap-h63xx.git [TIPC]: Add error check to detect non-blocking form of connect() This patch causes TIPC to return an error indication if the non- blocking form of connect() is requested (which TIPC does not yet support). Signed-off-by: Allan Stephens Signed-off-by: David S. Miller --- diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 4c83aba575c..348e4ff881a 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1260,6 +1260,11 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen, if (sock->state == SS_READY) return -EOPNOTSUPP; + /* For now, TIPC does not support the non-blocking form of connect() */ + + if (flags & O_NONBLOCK) + return -EWOULDBLOCK; + /* Issue Posix-compliant error code if socket is in the wrong state */ if (sock->state == SS_LISTENING)