mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-09-08 12:14:50 +00:00
rlimit_patch: update for dwl
This commit is contained in:
parent
6af0e5e209
commit
5dd53a5977
@ -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-05-19](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/rlimit_max/rlimit_max.patch)
|
||||
- [2024-06-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/rlimit_max/rlimit_max.patch)
|
||||
|
||||
### Authors
|
||||
- [sewn](https://codeberg.org/sewn)
|
||||
|
@ -1,14 +1,14 @@
|
||||
From 1a3a3290f1ecc3afe7d455c05b2742060406dae0 Mon Sep 17 00:00:00 2001
|
||||
From 9f80802ad639fe35efaeede485e9cd6e1f002486 Mon Sep 17 00:00:00 2001
|
||||
From: sewn <sewn@disroot.org>
|
||||
Date: Sun, 19 May 2024 20:06:32 +0300
|
||||
Date: Thu, 6 Jun 2024 16:57:13 +0300
|
||||
Subject: [PATCH] set max open file descriptors to available max
|
||||
|
||||
---
|
||||
dwl.c | 23 +++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
dwl.c | 22 ++++++++++++++++++++++
|
||||
1 file changed, 22 insertions(+)
|
||||
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index bf763df..eabea11 100644
|
||||
index 6f041a0..a28291e 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -7,6 +7,7 @@
|
||||
@ -19,7 +19,7 @@ index bf763df..eabea11 100644
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
@@ -308,6 +309,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
|
||||
@@ -311,6 +312,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
|
||||
double sx, double sy, uint32_t time);
|
||||
static void printstatus(void);
|
||||
static void quit(const Arg *arg);
|
||||
@ -27,7 +27,7 @@ index bf763df..eabea11 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);
|
||||
@@ -350,6 +352,7 @@ static void zoom(const Arg *arg);
|
||||
@@ -353,6 +355,7 @@ static void zoom(const Arg *arg);
|
||||
|
||||
/* variables */
|
||||
static const char broken[] = "broken";
|
||||
@ -35,7 +35,7 @@ index bf763df..eabea11 100644
|
||||
static pid_t child_pid = -1;
|
||||
static int locked;
|
||||
static void *exclusive_focus;
|
||||
@@ -1951,6 +1954,15 @@ quit(const Arg *arg)
|
||||
@@ -2014,6 +2017,15 @@ quit(const Arg *arg)
|
||||
wl_display_terminate(dpy);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ index bf763df..eabea11 100644
|
||||
void
|
||||
rendermon(struct wl_listener *listener, void *data)
|
||||
{
|
||||
@@ -2080,6 +2092,7 @@ run(char *startup_cmd)
|
||||
@@ -2143,6 +2155,7 @@ run(char *startup_cmd)
|
||||
if ((child_pid = fork()) < 0)
|
||||
die("startup: fork:");
|
||||
if (child_pid == 0) {
|
||||
@ -59,15 +59,15 @@ index bf763df..eabea11 100644
|
||||
dup2(piperw[0], STDIN_FILENO);
|
||||
close(piperw[0]);
|
||||
close(piperw[1]);
|
||||
@@ -2271,9 +2284,18 @@ setup(void)
|
||||
@@ -2333,10 +2346,18 @@ setsel(struct wl_listener *listener, void *data)
|
||||
void
|
||||
setup(void)
|
||||
{
|
||||
struct xkb_context *context;
|
||||
struct xkb_keymap *keymap;
|
||||
+ struct rlimit new_rlimit;
|
||||
|
||||
int i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
|
||||
struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = handlesig};
|
||||
+
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
||||
+ if (getrlimit(RLIMIT_NOFILE, &og_rlimit) < 0)
|
||||
+ die("getrlimit:");
|
||||
+ new_rlimit = og_rlimit;
|
||||
@ -75,10 +75,10 @@ index bf763df..eabea11 100644
|
||||
+ if (setrlimit(RLIMIT_NOFILE, &new_rlimit) < 0)
|
||||
+ die("setrlimit:");
|
||||
+
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
||||
for (i = 0; i < (int)LENGTH(sig); i++)
|
||||
@@ -2530,6 +2552,7 @@ void
|
||||
sigaction(sig[i], &sa, NULL);
|
||||
|
||||
@@ -2547,6 +2568,7 @@ void
|
||||
spawn(const Arg *arg)
|
||||
{
|
||||
if (fork() == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user