/* * (C)opyright MMIV-MMVI Anselm R. Garbe * See LICENSE file for license details. */ #include #include #include #include #include #include "wmii.h" void wmii_spawn(void *dpy, char *cmd) { /* the questionable double-fork is done to catch all zombies */ if(fork() == 0) { if(fork() == 0) { setsid(); close(ConnectionNumber(dpy)); execlp("rc", "rc", "-c", cmd, (char *) 0); perror("failed"); exit(1); } exit(0); } wait(0); }