mirror of
https://github.com/0intro/wmii
synced 2024-12-12 22:57:22 +03:00
28 lines
458 B
C
28 lines
458 B
C
/*
|
|
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
|
* See LICENSE file for license details.
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <sys/wait.h>
|
|
#include <unistd.h>
|
|
|
|
#include "wm.h"
|
|
|
|
void
|
|
spawn(char *cmd)
|
|
{
|
|
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);
|
|
}
|