1/************************************************************************ 2 * Some common routines to all programs but formail * 3 * * 4 * Copyright (c) 1993-1997, S.R. van den Berg, The Netherlands * 5 * #include "../README" * 6 ************************************************************************/ 7#ifdef RCS 8static /*const*/char rcsid[]= 9 "$Id: mcommon.c,v 1.5 1997/04/03 01:58:45 srb Exp $"; 10#endif 11#include "includes.h" 12#include "mcommon.h" 13 14static volatile int gotsig; 15 16static void fakehandler P((void)) 17{ gotsig=1; 18} 19 20void qsignal(sig,action)const int sig;void(*action)P((void)); 21{ gotsig=0; 22 if(SIG_IGN==signal(sig,(void(*)())fakehandler)) 23 signal(sig,SIG_IGN); 24 else 25 { signal(sig,(void(*)())action); 26 if(gotsig) 27 (*action)(); 28 } 29} 30