Patchwork [net-next,03/14] tipc: Provide correct error code for unsupported connect() operation

login
register
mail settings
Submitter Paul Gortmaker
Date Aug. 17, 2010, 9 p.m.
Message ID <1282078816-11844-4-git-send-email-paul.gortmaker@windriver.com>
Download mbox | patch
Permalink /patch/61958/
State Accepted
Delegated to: David Miller
Headers show

Comments

Paul Gortmaker - Aug. 17, 2010, 9 p.m.
From: Allan Stephens <allan.stephens@windriver.com>

Modify TIPC to return EOPNOTSUPP if an application attempts to perform
 a non-blocking connect() operation, which is not supported by TIPC.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 69d0fd1..b89c7b1 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1380,7 +1380,7 @@  static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
 	/* For now, TIPC does not support the non-blocking form of connect() */
 
 	if (flags & O_NONBLOCK) {
-		res = -EWOULDBLOCK;
+		res = -EOPNOTSUPP;
 		goto exit;
 	}