X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fflame.c;h=9d3543c1482db113964cd2b02353064800c75e50;hb=14463b6ad1ab1ccf81f9c33350b048e410ba94cb;hp=0cc7f65970fb5f0f8e1ca7d790319e97fb97504c;hpb=f65151994eba80ecabcdac6eef6fa0dde7e2d45b;p=xscreensaver diff --git a/hacks/flame.c b/hacks/flame.c index 0cc7f659..9d3543c1 100644 --- a/hacks/flame.c +++ b/hacks/flame.c @@ -52,6 +52,8 @@ #include #include "screenhack.h" +#include /* so we can ignore SIGFPE */ + #define POINT_BUFFER_SIZE 10 #define MAXLEV 4 #define MAXKINDS 10 @@ -100,6 +102,15 @@ init_flame (Display *dpy, Window window) XGCValues gcv; XWindowAttributes xgwa; Colormap cmap; + +#if defined(SIGFPE) && defined(SIG_IGN) + /* No doubt a better fix would be to track down where the NaN is coming + from, and code around that; but this should do. Apparently most systems + (Linux, Solaris, Irix, ...) ignore FPE by default -- but FreeBSD dumps + core by default. */ + signal (SIGFPE, SIG_IGN); +#endif + XGetWindowAttributes (dpy, window, &xgwa); width = xgwa.width; height = xgwa.height; @@ -361,9 +372,12 @@ flame (Display *dpy, Window window) } -#ifdef __hpux +#if defined(__hpux) && defined(PLOSS) /* I don't understand why this is necessary, but I'm told that this program does nothing at all on HP-sUX without it. + + I'm further told that HPUX 11.0 doesn't define PLOSS, and works ok without + this section. Go figure. */ #undef random #undef srandom