diff options
author | Bernard Normier <bernard@zeroc.com> | 2010-05-17 17:21:47 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2010-05-17 17:21:47 -0400 |
commit | 777f51e84d413efaed099bddba96c03c4c51eb17 (patch) | |
tree | d4bcfee203f4dd4244f90014f1b728770142f0c1 /cpp/test/Ice/interceptor/Client.cpp | |
parent | Updated openssl makefile for VC6 (diff) | |
download | ice-777f51e84d413efaed099bddba96c03c4c51eb17.tar.bz2 ice-777f51e84d413efaed099bddba96c03c4c51eb17.tar.xz ice-777f51e84d413efaed099bddba96c03c4c51eb17.zip |
SIGPIPE patch for Blair / Imageworks
Diffstat (limited to 'cpp/test/Ice/interceptor/Client.cpp')
-rw-r--r-- | cpp/test/Ice/interceptor/Client.cpp | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/cpp/test/Ice/interceptor/Client.cpp b/cpp/test/Ice/interceptor/Client.cpp index fcc22033074..c20cfe8cf4c 100644 --- a/cpp/test/Ice/interceptor/Client.cpp +++ b/cpp/test/Ice/interceptor/Client.cpp @@ -15,6 +15,14 @@ #include <AMDInterceptorI.h> #include <iostream> +#ifndef _WIN32 +// +// SIGPIPE test +// +# include <signal.h> +#endif + + using namespace std; class Client : public Ice::Application @@ -29,16 +37,55 @@ private: int runAmd(const Test::MyObjectPrx&, const AMDInterceptorIPtr&); }; +#ifndef _WIN32 +void testAction(int) +{ + test(false); +} +#endif + int main(int argc, char* argv[]) { +#ifndef _WIN32 +// +// Set SIGPIPE action +// + struct sigaction action; + action.sa_handler = &testAction; + sigemptyset(&action.sa_mask); + action.sa_flags = 0; + sigaction(SIGPIPE, &action, 0); +#endif + Client app; - return app.main(argc, argv); + int result = app.main(argc, argv); + +#ifndef _WIN32 +// +// Check SIGPIPE was properly reset to old action +// + struct sigaction newAction; + sigaction(SIGPIPE, 0, &newAction); + test(action.sa_handler == &testAction); +#endif + + return result; } int Client::run(int, char*[]) { + +#ifndef _WIN32 +// +// Check SIGPIPE is now SIG_IGN +// + struct sigaction action; + sigaction(SIGPIPE, 0, &action); + test(action.sa_handler == SIG_IGN); +#endif + // // Create OA and servants // |