aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2026-10-13 14:42:56 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2026-10-16 13:26:00 +0200
commit1d07715ebdf41f293b8de0c027932e71d8360a36 (patch)
tree00ab10c6548a294b7059b5030c9da79f41158537 /dwm.c
parentebfe6719885e1b567d59828be3dc27cb5a0d4adf (diff)
print an error if fork failed (resource / process limits)
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/dwm.c b/dwm.c
index 212c6ba..3f45aab 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1654,10 +1654,16 @@ void
spawn(const Arg *arg)
{
struct sigaction sa;
+ pid_t pid;
if (arg->v == dmenucmd)
dmenumon[0] = '0' + selmon->num;
- if (fork() == 0) {
+
+ if ((pid = fork()) == -1) {
+ fprintf(stderr, "dwm: fork failed: %s\n", strerror(errno));
+ return;
+ }
+ if (pid == 0) {
if (dpy)
close(ConnectionNumber(dpy));
setsid();