coredump: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031

This commit is contained in:
Leonardo Hernández Hernández 2024-07-22 22:49:47 -06:00
parent 3b3a071bdd
commit 78390e597f
No known key found for this signature in database
GPG Key ID: E538897EE11B9624
2 changed files with 12 additions and 12 deletions

View File

@ -4,7 +4,7 @@ compile dwl and wlroots with debug symbols)
### Download ### Download
- [git branch](https://codeberg.org/sevz/dwl/src/branch/coredump) - [git branch](https://codeberg.org/sevz/dwl/src/branch/coredump)
- [2024-06-07](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/coredump/coredump.patch) - [main 2024-09-01](/dwl/dwl-patches/raw/branch/main/patches/coredump/coredump.patch)
- [coredump-0.7.patch](/dwl/dwl-patches/raw/branch/main/patches/coredump/coredump-0.7.patch) - [coredump-0.7.patch](/dwl/dwl-patches/raw/branch/main/patches/coredump/coredump-0.7.patch)
### Authors ### Authors

View File

@ -1,6 +1,6 @@
From 5ffa5ec3a2a6f90a8a6345c6f1f7b9f197742aad Mon Sep 17 00:00:00 2001 From ab8abc0186ad74e24bdf9e4f3af00d03ac269631 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@protonmail.com> <leohdz172@proton.me>
Date: Wed, 5 Oct 2022 23:07:13 -0500 Date: Wed, 5 Oct 2022 23:07:13 -0500
Subject: [PATCH] increase RLIMIT_CORE (generate a coredump) Subject: [PATCH] increase RLIMIT_CORE (generate a coredump)
MIME-Version: 1.0 MIME-Version: 1.0
@ -13,10 +13,10 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
1 file changed, 9 insertions(+) 1 file changed, 9 insertions(+)
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index 6f041a0d..cb52be99 100644 index 9021e442..3af09d54 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>
@ -24,24 +24,24 @@ index 6f041a0d..cb52be99 100644
#include <sys/wait.h> #include <sys/wait.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
@@ -353,6 +354,8 @@ static void zoom(const Arg *arg); @@ -357,6 +358,8 @@ static void xytonode(double x, double y, struct wlr_surface **psurface,
static void zoom(const Arg *arg);
/* variables */ /* variables */
static const char broken[] = "broken";
+static struct rlimit oldrlimit; +static struct rlimit oldrlimit;
+static struct rlimit newrlimit; +static struct rlimit newrlimit;
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;
@@ -2143,6 +2146,7 @@ run(char *startup_cmd) @@ -2201,6 +2204,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) {
+ setrlimit(RLIMIT_CORE, &oldrlimit); + setrlimit(RLIMIT_CORE, &oldrlimit);
setsid();
dup2(piperw[0], STDIN_FILENO); dup2(piperw[0], STDIN_FILENO);
close(piperw[0]); close(piperw[0]);
close(piperw[1]); @@ -2609,6 +2613,7 @@ void
@@ -2547,6 +2551,7 @@ void
spawn(const Arg *arg) spawn(const Arg *arg)
{ {
if (fork() == 0) { if (fork() == 0) {
@ -49,7 +49,7 @@ index 6f041a0d..cb52be99 100644
dup2(STDERR_FILENO, STDOUT_FILENO); dup2(STDERR_FILENO, STDOUT_FILENO);
setsid(); setsid();
execvp(((char **)arg->v)[0], (char **)arg->v); execvp(((char **)arg->v)[0], (char **)arg->v);
@@ -3083,6 +3088,10 @@ main(int argc, char *argv[]) @@ -3156,6 +3161,10 @@ main(int argc, char *argv[])
char *startup_cmd = NULL; char *startup_cmd = NULL;
int c; int c;
@ -61,5 +61,5 @@ index 6f041a0d..cb52be99 100644
if (c == 's') if (c == 's')
startup_cmd = optarg; startup_cmd = optarg;
-- --
2.45.2 2.46.0