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.
### Download
- [git branch](https://codeberg.org/sewn/dwl/src/branch/rlimit_max)
- [2024-06-26](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/rlimit_max/rlimit_max.patch)
- [0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/rlimit_max/rlimit_max.patch)
### Authors
- [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>
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
---
@ -8,10 +8,10 @@ Subject: [PATCH] set max open file descriptors to available max
1 file changed, 22 insertions(+)
diff --git a/dwl.c b/dwl.c
index 00e9cc1..ddd4a3a 100644
index a2711f6..163ebdd 100644
--- a/dwl.c
+++ b/dwl.c
@@ -7,6 +7,7 @@
@@ -8,6 +8,7 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@ -19,7 +19,7 @@ index 00e9cc1..ddd4a3a 100644
#include <sys/wait.h>
#include <time.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 powermgrsetmode(struct wl_listener *listener, void *data);
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 requestdecorationmode(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 */
static const char broken[] = "broken";
@ -35,7 +35,7 @@ index 00e9cc1..ddd4a3a 100644
static pid_t child_pid = -1;
static int locked;
static void *exclusive_focus;
@@ -2041,6 +2044,15 @@ quit(const Arg *arg)
@@ -2096,6 +2099,15 @@ quit(const Arg *arg)
wl_display_terminate(dpy);
}
@ -51,7 +51,7 @@ index 00e9cc1..ddd4a3a 100644
void
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)
die("startup: fork:");
if (child_pid == 0) {
@ -59,7 +59,7 @@ index 00e9cc1..ddd4a3a 100644
setsid();
dup2(piperw[0], STDIN_FILENO);
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
setup(void)
{
@ -78,7 +78,7 @@ index 00e9cc1..ddd4a3a 100644
for (i = 0; i < (int)LENGTH(sig); i++)
sigaction(sig[i], &sa, NULL);
@@ -2584,6 +2605,7 @@ void
@@ -2649,6 +2670,7 @@ void
spawn(const Arg *arg)
{
if (fork() == 0) {
@ -87,5 +87,5 @@ index 00e9cc1..ddd4a3a 100644
setsid();
execvp(((char **)arg->v)[0], (char **)arg->v);
--
2.45.2
2.46.0