rlimit_max: 0.7

This commit is contained in:
sewn 2024-08-25 22:10:27 +03:00
parent d274bfed40
commit 38f6c90637
No known key found for this signature in database
2 changed files with 12 additions and 13 deletions

View File

@ -4,8 +4,7 @@ Sets the current maximum open file descriptors to the maximum available limit.
This patch is useful - and solves issue [#628](https://codeberg.org/dwl/dwl/issues/628) for running heavy Xwayland applications on systems that do not provide limits out of the box. This patch is useful - and solves issue [#628](https://codeberg.org/dwl/dwl/issues/628) for running heavy Xwayland applications on systems that do not provide limits out of the box.
### Download ### Download
- [git branch](https://codeberg.org/sewn/dwl/src/branch/rlimit_max) - [0.7](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 ### Authors
- [sewn](https://codeberg.org/sewn) - [sewn](https://codeberg.org/sewn)

View File

@ -1,6 +1,6 @@
From f464dbbeb0c13ab3268b3e64f6d0f30efb84d4e7 Mon Sep 17 00:00:00 2001 From d25a8222651671613322677d17b2f987135e02cd Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org> From: sewn <sewn@disroot.org>
Date: Thu, 6 Jun 2024 16:57:13 +0300 Date: Sat, 24 Aug 2024 19:26:26 +0300
Subject: [PATCH] set max open file descriptors to available max Subject: [PATCH] set max open file descriptors to available max
--- ---
@ -8,10 +8,10 @@ Subject: [PATCH] set max open file descriptors to available max
1 file changed, 22 insertions(+) 1 file changed, 22 insertions(+)
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index 00e9cc1..ddd4a3a 100644 index a2711f6..163ebdd 100644
--- a/dwl.c --- a/dwl.c
+++ b/dwl.c +++ b/dwl.c
@@ -7,6 +7,7 @@ @@ -8,6 +8,7 @@
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -19,7 +19,7 @@ index 00e9cc1..ddd4a3a 100644
#include <sys/wait.h> #include <sys/wait.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
@@ -314,6 +315,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface, @@ -316,6 +317,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
static void printstatus(void); static void printstatus(void);
static void powermgrsetmode(struct wl_listener *listener, void *data); static void powermgrsetmode(struct wl_listener *listener, void *data);
static void quit(const Arg *arg); static void quit(const Arg *arg);
@ -27,7 +27,7 @@ index 00e9cc1..ddd4a3a 100644
static void rendermon(struct wl_listener *listener, void *data); static void rendermon(struct wl_listener *listener, void *data);
static void requestdecorationmode(struct wl_listener *listener, void *data); static void requestdecorationmode(struct wl_listener *listener, void *data);
static void requeststartdrag(struct wl_listener *listener, void *data); static void requeststartdrag(struct wl_listener *listener, void *data);
@@ -356,6 +358,7 @@ static void zoom(const Arg *arg); @@ -358,6 +360,7 @@ static void zoom(const Arg *arg);
/* variables */ /* variables */
static const char broken[] = "broken"; static const char broken[] = "broken";
@ -35,7 +35,7 @@ index 00e9cc1..ddd4a3a 100644
static pid_t child_pid = -1; static pid_t child_pid = -1;
static int locked; static int locked;
static void *exclusive_focus; static void *exclusive_focus;
@@ -2041,6 +2044,15 @@ quit(const Arg *arg) @@ -2096,6 +2099,15 @@ quit(const Arg *arg)
wl_display_terminate(dpy); wl_display_terminate(dpy);
} }
@ -51,7 +51,7 @@ index 00e9cc1..ddd4a3a 100644
void void
rendermon(struct wl_listener *listener, void *data) rendermon(struct wl_listener *listener, void *data)
{ {
@@ -2176,6 +2188,7 @@ run(char *startup_cmd) @@ -2232,6 +2244,7 @@ run(char *startup_cmd)
if ((child_pid = fork()) < 0) if ((child_pid = fork()) < 0)
die("startup: fork:"); die("startup: fork:");
if (child_pid == 0) { if (child_pid == 0) {
@ -59,7 +59,7 @@ index 00e9cc1..ddd4a3a 100644
setsid(); setsid();
dup2(piperw[0], STDIN_FILENO); dup2(piperw[0], STDIN_FILENO);
close(piperw[0]); close(piperw[0]);
@@ -2367,10 +2380,18 @@ setsel(struct wl_listener *listener, void *data) @@ -2429,10 +2442,18 @@ setsel(struct wl_listener *listener, void *data)
void void
setup(void) setup(void)
{ {
@ -78,7 +78,7 @@ index 00e9cc1..ddd4a3a 100644
for (i = 0; i < (int)LENGTH(sig); i++) for (i = 0; i < (int)LENGTH(sig); i++)
sigaction(sig[i], &sa, NULL); sigaction(sig[i], &sa, NULL);
@@ -2584,6 +2605,7 @@ void @@ -2649,6 +2670,7 @@ void
spawn(const Arg *arg) spawn(const Arg *arg)
{ {
if (fork() == 0) { if (fork() == 0) {
@ -87,5 +87,5 @@ index 00e9cc1..ddd4a3a 100644
setsid(); setsid();
execvp(((char **)arg->v)[0], (char **)arg->v); execvp(((char **)arg->v)[0], (char **)arg->v);
-- --
2.45.2 2.46.0