rlimit_max: 2024-06-26

This commit is contained in:
sewn 2024-06-26 10:14:15 +03:00
parent 5ce3fdc2ed
commit d59e8cca26
No known key found for this signature in database
2 changed files with 12 additions and 12 deletions

View File

@ -5,7 +5,7 @@ This patch is useful - and solves issue [#628](https://codeberg.org/dwl/dwl/issu
### Download
- [git branch](https://codeberg.org/sewn/dwl/src/branch/rlimit_max)
- [2024-06-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/rlimit_max/rlimit_max.patch)
- [2024-06-26](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/rlimit_max/rlimit_max.patch)
### Authors
- [sewn](https://codeberg.org/sewn)

View File

@ -1,4 +1,4 @@
From 9f80802ad639fe35efaeede485e9cd6e1f002486 Mon Sep 17 00:00:00 2001
From f464dbbeb0c13ab3268b3e64f6d0f30efb84d4e7 Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org>
Date: Thu, 6 Jun 2024 16:57:13 +0300
Subject: [PATCH] set max open file descriptors to available max
@ -8,7 +8,7 @@ Subject: [PATCH] set max open file descriptors to available max
1 file changed, 22 insertions(+)
diff --git a/dwl.c b/dwl.c
index 6f041a0..a28291e 100644
index 00e9cc1..ddd4a3a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -7,6 +7,7 @@
@ -19,15 +19,15 @@ index 6f041a0..a28291e 100644
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
@@ -311,6 +312,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
double sx, double sy, uint32_t time);
@@ -314,6 +315,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
static void printstatus(void);
static void powermgrsetmode(struct wl_listener *listener, void *data);
static void quit(const Arg *arg);
+static void restorerlimit(void);
static void rendermon(struct wl_listener *listener, void *data);
static void requestdecorationmode(struct wl_listener *listener, void *data);
static void requeststartdrag(struct wl_listener *listener, void *data);
@@ -353,6 +355,7 @@ static void zoom(const Arg *arg);
@@ -356,6 +358,7 @@ static void zoom(const Arg *arg);
/* variables */
static const char broken[] = "broken";
@ -35,7 +35,7 @@ index 6f041a0..a28291e 100644
static pid_t child_pid = -1;
static int locked;
static void *exclusive_focus;
@@ -2014,6 +2017,15 @@ quit(const Arg *arg)
@@ -2041,6 +2044,15 @@ quit(const Arg *arg)
wl_display_terminate(dpy);
}
@ -51,15 +51,15 @@ index 6f041a0..a28291e 100644
void
rendermon(struct wl_listener *listener, void *data)
{
@@ -2143,6 +2155,7 @@ run(char *startup_cmd)
@@ -2176,6 +2188,7 @@ run(char *startup_cmd)
if ((child_pid = fork()) < 0)
die("startup: fork:");
if (child_pid == 0) {
+ restorerlimit();
setsid();
dup2(piperw[0], STDIN_FILENO);
close(piperw[0]);
close(piperw[1]);
@@ -2333,10 +2346,18 @@ setsel(struct wl_listener *listener, void *data)
@@ -2367,10 +2380,18 @@ setsel(struct wl_listener *listener, void *data)
void
setup(void)
{
@ -78,7 +78,7 @@ index 6f041a0..a28291e 100644
for (i = 0; i < (int)LENGTH(sig); i++)
sigaction(sig[i], &sa, NULL);
@@ -2547,6 +2568,7 @@ void
@@ -2584,6 +2605,7 @@ void
spawn(const Arg *arg)
{
if (fork() == 0) {
@ -87,5 +87,5 @@ index 6f041a0..a28291e 100644
setsid();
execvp(((char **)arg->v)[0], (char **)arg->v);
--
2.45.0
2.45.2