aboutsummaryrefslogtreecommitdiffstats
path: root/modules/autostart/autostart.c
blob: d947972301e19c24f59a63882294f0b1ef61c530 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void
runautostart(void)
{
	const char *const *cmd = autostart;

	if (fork() == 0) {
		setsid();

		while (*cmd != NULL) {
			if (fork() == 0) {
				execl("/bin/sh", "sh", "-c", *cmd, NULL);
				exit(1);
			}
			cmd++;
		}
		exit(0);
	}
}