diff options
| author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2026-10-13 14:42:56 +0200 |
|---|---|---|
| committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2026-10-16 13:26:00 +0200 |
| commit | 1d07715ebdf41f293b8de0c027932e71d8360a36 (patch) | |
| tree | 00ab10c6548a294b7059b5030c9da79f41158537 | |
| parent | check return value of XGetModifierMapping (diff) | |
| download | dwm-1d07715ebdf41f293b8de0c027932e71d8360a36.tar.gz dwm-1d07715ebdf41f293b8de0c027932e71d8360a36.zip | |
print an error if fork failed (resource / process limits)
| -rw-r--r-- | dwm.c | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -1654,10 +1654,16 @@ void | |||
| 1654 | spawn(const Arg *arg) | 1654 | spawn(const Arg *arg) |
| 1655 | { | 1655 | { |
| 1656 | struct sigaction sa; | 1656 | struct sigaction sa; |
| 1657 | pid_t pid; | ||
| 1657 | 1658 | ||
| 1658 | if (arg->v == dmenucmd) | 1659 | if (arg->v == dmenucmd) |
| 1659 | dmenumon[0] = '0' + selmon->num; | 1660 | dmenumon[0] = '0' + selmon->num; |
| 1660 | if (fork() == 0) { | 1661 | |
| 1662 | if ((pid = fork()) == -1) { | ||
| 1663 | fprintf(stderr, "dwm: fork failed: %s\n", strerror(errno)); | ||
| 1664 | return; | ||
| 1665 | } | ||
| 1666 | if (pid == 0) { | ||
| 1661 | if (dpy) | 1667 | if (dpy) |
| 1662 | close(ConnectionNumber(dpy)); | 1668 | close(ConnectionNumber(dpy)); |
| 1663 | setsid(); | 1669 | setsid(); |
