unsigned int interval;
unsigned int signal;
} Block;
+void dummysighandler(int num);
void sighandler(int num);
void replace(char *str, char old, char new);
void getcmds(int time);
{
const Block* current;
for(int i = 0; i < LENGTH(blocks); i++)
- {
+ {
current = blocks + i;
if ((current->interval != 0 && time % current->interval == 0) || time == -1)
getcmd(current,statusbar[i]);
void setupsignals()
{
+ /* initialize all real time signals with dummy handler */
+ for(int i = SIGRTMIN; i <= SIGRTMAX; i++)
+ signal(i, dummysighandler);
+
for(int i = 0; i < LENGTH(blocks); i++)
- {
+ {
if (blocks[i].signal > 0)
signal(SIGRTMIN+blocks[i].signal, sighandler);
}
}
}
+#ifndef __OpenBSD__
+/* this signal handler should do nothing */
+void dummysighandler(int signum)
+{
+ return;
+}
+#endif
+
#ifndef __OpenBSD__
void sighandler(int signum)
{
int main(int argc, char** argv)
{
for(int i = 0; i < argc; i++)
- {
+ {
if (!strcmp("-d",argv[i]))
delim = argv[++i][0];
else if(!strcmp("-p",argv[i]))