diff options
| author | Nikita Langer <nikitalanger@icloud.com> | 2026-04-06 22:13:26 +0200 |
|---|---|---|
| committer | Nikita Langer <nikitalanger@icloud.com> | 2026-04-06 22:13:26 +0200 |
| commit | dad6dc77433e661b54458978cb888fd38ae15a97 (patch) | |
| tree | ed0ea2232063526124609e8e1fde67bdff72031d /modules/autostart/autostart.c | |
| download | vxwm-master.tar.gz vxwm-master.tar.bz2 vxwm-master.tar.xz vxwm-master.zip | |
Diffstat (limited to 'modules/autostart/autostart.c')
| -rw-r--r-- | modules/autostart/autostart.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/autostart/autostart.c b/modules/autostart/autostart.c new file mode 100644 index 0000000..d947972 --- /dev/null +++ b/modules/autostart/autostart.c @@ -0,0 +1,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); + } +} |
