From: VMware, Inc <> Date: Mon, 26 Sep 2011 18:21:08 +0000 (-0700) Subject: shutdownStreamTest fails on RHEL6.1 X-Git-Tag: 2011.09.23-491607~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3240978820f65936ef755f80ffa8a6bdafd68956;p=thirdparty%2Fopen-vm-tools.git shutdownStreamTest fails on RHEL6.1 The problem is that the test is broken for Linux, and it appears to work with INET but actually it doesn't. What happens with /st is that when we do the send(), we actually get a SIG_PIPE, and the process exits, but there's no error message, so it looks like the test passes. Based on this pass, when running the same test for vSockets, it seems like we don't match the behavior because we fail. But fixing the signal problem, by passing MSG_NOSIGNAL to the send, makes it fail for INET too. So now the test fails for both system sockets and vSockets The correct behavior on Linux is for the final recv() to succeed. Even with a local shutdown, the socket should return 0 after a recv(). This change fixes the test to expect 0 on Linux (and failure only for Windows, which is correct). Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/modules/linux/vsock/linux/vsockSocketWrapper.h b/open-vm-tools/modules/linux/vsock/linux/vsockSocketWrapper.h index 597edeefe..9f212fddb 100644 --- a/open-vm-tools/modules/linux/vsock/linux/vsockSocketWrapper.h +++ b/open-vm-tools/modules/linux/vsock/linux/vsockSocketWrapper.h @@ -154,6 +154,7 @@ # define EHOSTDOWN WSAEHOSTDOWN # define EHOSTUNREACH WSAEHOSTUNREACH # define __ELOCALSHUTDOWN ESHUTDOWN +# define __ELOCALRCVSHUTDOWN __ELOCALSHUTDOWN # define __EPEERSHUTDOWN ECONNABORTED # define __ECONNINPROGRESS EWOULDBLOCK # define __ESNDRCVTIMEDOUT ETIMEDOUT @@ -199,12 +200,14 @@ # define EHOSTUNREACH VMK_EHOSTUNREACH # define EPIPE VMK_BROKEN_PIPE # define __ELOCALSHUTDOWN EPIPE +# define __ELOCALRCVSHUTDOWN 0 # define __EPEERSHUTDOWN EPIPE # define __ECONNINPROGRESS EINPROGRESS # define __ESNDRCVTIMEDOUT VMK_WOULD_BLOCK # define ESYSNOTREADY VMK_NOT_SUPPORTED #elif defined(__APPLE__) # define __ELOCALSHUTDOWN ESHUTDOWN +# define __ELOCALRCVSHUTDOWN 0 # define __EPEERSHUTDOWN ECONNABORTED # define __ECONNINPROGRESS EINPROGRESS # define __ESNDRCVTIMEDOUT EAGAIN