1 module utils; 2 3 import legacy; 4 import std.stdio; 5 import core.sys.posix.signal; 6 7 import x11.X; 8 import x11.Xlib; 9 import x11.keysymdef; 10 import x11.Xutil; 11 import x11.Xatom; 12 13 void sigchld(int unused) nothrow 14 { 15 if(signal(SIGCHLD, &sigchldImpl) == SIG_ERR) { 16 die("Can't install SIGCHLD handler"); 17 } 18 sigchldImpl(unused); 19 } 20 21 auto die(F, A...)(lazy F fmt, lazy A args) nothrow 22 { 23 import std.c.stdlib; 24 try { 25 std.stdio.stderr.writefln("\n\n"~fmt~"\n\n", args); 26 } catch {} 27 exit(EXIT_FAILURE); 28 } 29 30