示例#1
0
static void savevardef(void)
{ 
  FWRITE1(vardef->nvar,archiv);
  if(vardef->nvar && 
        fwrite(vardef->vars, (vardef->nvar)*sizeof(varinfo) ,1,archiv)!=1)
   wAbort();
}
示例#2
0
static void  savepoly(poly p)
{

 int width;
 char * b, *e;
 poly zero=plusone();

 zero->num=0;    
 
 b=(char*)&(zero->num);
 if(vardef->nvar) e=(char*)&(zero->power[vardef->vars[vardef->nvar-1].wordpos]); 
       else       e=(char*)&(zero->power[0]); 
 width=e-b;
 
 while(p) { if(fwrite(&(p->num),width,1,archiv)!=1) wAbort(); p=p->next; }

 if(fwrite(&(zero->num),width,1,archiv)!=1) wAbort();  

}
示例#3
0
文件: startup.c 项目: jafd/wmaker
/*
 *----------------------------------------------------------------------
 * handleSig--
 * 	general signal handler. Exits the program gently.
 *----------------------------------------------------------------------
 */
static RETSIGTYPE handleSig(int sig)
{
	wfatal("got signal %i", sig);

	/* Setting the signal behaviour back to default and then reraising the
	 * signal is a cleaner way to make program exit and core dump than calling
	 * abort(), since it correctly returns from the signal handler and sets
	 * the flags accordingly. -Dan
	 */
	if (sig == SIGSEGV || sig == SIGFPE || sig == SIGBUS || sig == SIGILL || sig == SIGABRT) {
		signal(sig, SIG_DFL);
		kill(getpid(), sig);
		return;
	}

	wAbort(0);
}