static void cleanup(void);
static bool clock_expired = false;
+static sigset_t block_mask;
static int uc = ERR;
if (sigaction(SIGHUP, &act, NULL) != 0)
err(EXIT_FAILURE, "sigaction(SIGHUP)");
+ /* Block mask */
+ (void)sigemptyset(&block_mask);
+ (void)sigaddset(&block_mask, SIGALRM);
+
/* Setup interval timer */
timerclear(&itv.it_interval);
timerclear(&itv.it_value);
return c;
}
+void
+safe_refresh(void)
+{
+ sigset_t set;
+
+ /* Temporarily block the SIGALRM signal during output syscalls */
+ set = block_mask;
+ (void)sigprocmask(SIG_BLOCK, &set, NULL);
+
+ (void)wrefresh(win);
+
+ set = block_mask;
+ (void)sigprocmask(SIG_UNBLOCK, &set, NULL);
+}
+
+
/*
* On some systems like OSX [n]curses endwin() is not enough to properly
#endif
#include "randmac.h"
+#include "main.h"
#ifdef __USE_SDL__
game_object encrazify(game_object lander, game_object crazy, Mix_Chunk *sound, int channel){
};
//get the cursor out of the way
mvprintw(23,79,"-");
- refresh();
+ safe_refresh();
};
};
};