| 1 |
< |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 1 |
> |
/* Copyright (c) 1999 Silicon Graphics, Inc. */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ SGI"; |
| 14 |
|
#include <sys/types.h> |
| 15 |
|
#include <sys/stat.h> |
| 16 |
|
|
| 17 |
+ |
#ifndef RTFLUSH |
| 18 |
+ |
#define RTFLUSH 0 /* flush one at a time in batch */ |
| 19 |
+ |
#endif |
| 20 |
|
#ifndef FRAGWARN |
| 21 |
|
#define FRAGWARN 20 /* fragmentation for warning (%) */ |
| 22 |
|
#endif |
| 150 |
|
{ |
| 151 |
|
static int gotsig = 0; |
| 152 |
|
|
| 153 |
< |
if (gotsig++) /* two signals and we're gone! */ |
| 153 |
> |
if (gotsig > 1) /* we're going as fast as we can! */ |
| 154 |
> |
return; |
| 155 |
> |
if (gotsig++) { /* two signals and we split */ |
| 156 |
> |
hdsync(NULL, 0); /* don't leave w/o saying goodbye */ |
| 157 |
|
_exit(signo); |
| 158 |
< |
|
| 159 |
< |
alarm(120); /* allow 2 minutes to clean up */ |
| 154 |
< |
signal(SIGALRM, SIG_DFL); /* make certain we do die */ |
| 158 |
> |
} |
| 159 |
> |
alarm(300); /* allow 5 minutes to clean up */ |
| 160 |
|
eputs("signal - "); |
| 161 |
|
eputs(sigerr[signo]); |
| 162 |
|
eputs("\n"); |
| 516 |
|
p->nr*sizeof(RAYVAL)); |
| 517 |
|
if (outdev != NULL) /* display it */ |
| 518 |
|
disp_packet((PACKHEAD *)p); |
| 519 |
< |
if (hdcachesize <= 0) /* manual flushing */ |
| 519 |
> |
if (hdcachesize <= 0) { |
| 520 |
> |
#if RTFLUSH |
| 521 |
> |
if (outdev == NULL) |
| 522 |
> |
hdfreebeam(hdlist[p->hd], p->bi); |
| 523 |
> |
#endif |
| 524 |
|
n2flush++; |
| 525 |
+ |
} |
| 526 |
|
nraysdone += p->nr; |
| 527 |
|
npacksdone++; |
| 528 |
|
p->nr = 0; |
| 535 |
|
#else |
| 536 |
|
if (n2flush > 50*totqlen) { |
| 537 |
|
#endif |
| 538 |
< |
if (outdev == NULL) |
| 539 |
< |
hdflush(NULL); /* flush holodeck buffers */ |
| 538 |
> |
#if RTFLUSH |
| 539 |
> |
hdsync(NULL, outdev!=NULL); /* sync beams & directories */ |
| 540 |
> |
#else |
| 541 |
> |
if (outdev != NULL) |
| 542 |
> |
hdsync(NULL, 1); |
| 543 |
|
else |
| 544 |
< |
hdsync(NULL, 1); /* sync holodeck file */ |
| 544 |
> |
hdflush(NULL); |
| 545 |
> |
#endif |
| 546 |
|
n2flush = 0; |
| 547 |
|
} |
| 548 |
|
} |