Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

errcode.cc

Go to the documentation of this file.
00001 //**************************************************************************
00002 #include <iostream.h>
00003 #include <signal.h>
00004 #include "errcode.h"
00005 #include <ctype.h>
00006 //**************************************************************************
00007 static void my_signal_handler(int sig)
00008 {
00009 cout << "Caught SIGPIPE!!" << endl << flush;
00010 int err = ERR_SIGPIPE;
00011 //pthread_exit(NULL);
00012 throw err;
00013 }
00014 //**************************************************************************
00015 #ifdef HPUX
00016 struct sigaction sigpipe_handler = {(void (*)(int,__siginfo *,void *)) my_signal_handler, 0, 0};
00017 #else
00018 struct sigaction sigpipe_handler = {(void (*)(int)) my_signal_handler, 0, 0};
00019 #endif
00020 //**************************************************************************
00021 void trap_sigpipe()
00022 {
00023 signal(SIGABRT, SIG_IGN);
00024 sigaction(SIGPIPE, &sigpipe_handler, 0);
00025 }
00026 //**************************************************************************

Generated on Sun Jun 16 17:36:49 2002 for POSSE: Portable Object-oriented Scientific Steering Environment by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001