]> git.proxmox.com Git - systemd.git/commitdiff
Remove unused initialize_coredump() function
authorMichael Biebl <biebl@debian.org>
Tue, 12 Oct 2021 11:16:59 +0000 (13:16 +0200)
committerMichael Biebl <biebl@debian.org>
Tue, 12 Oct 2021 11:23:08 +0000 (13:23 +0200)
This patch removes the call to initialize_coredump() which currently
triggers the following warning:

../src/core/main.c:1641:13: warning: â€˜initialize_coredump’ defined but not used [-Wunused-function]
 1641 | static void initialize_coredump(bool skip_setup) {
      |             ^~~~~~~~~~~~~~~~~~~

With upstream commit
https://github.com/systemd/systemd/commit/702d40270a2984dda9f457febcba805ea458b4ad
this will become an error, so remove the unused function as well.

Gbp-Dch: Short

debian/patches/debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch

index 8ce1c35ff01d385a06caa760d283448bc26e98af..ff45ff672f1b79afb8fe6059032b48af716c4708 100644 (file)
@@ -14,15 +14,41 @@ isn't what RLIMIT_CORE is supposed to do (it limits the size of the core
 
 Bug-Debian: https://bugs.debian.org/815020
 ---
- src/core/main.c              | 2 --
- sysctl.d/50-coredump.conf.in | 2 +-
- 2 files changed, 1 insertion(+), 3 deletions(-)
+ src/core/main.c              | 21 ---------------------
+ sysctl.d/50-coredump.conf.in |  2 +-
+ 2 files changed, 1 insertion(+), 22 deletions(-)
 
 diff --git a/src/core/main.c b/src/core/main.c
-index b32a19a..f418166 100644
+index b32a19a..7038171 100644
 --- a/src/core/main.c
 +++ b/src/core/main.c
-@@ -2732,8 +2732,6 @@ int main(int argc, char *argv[]) {
+@@ -1651,25 +1651,6 @@ static void cmdline_take_random_seed(void) {
+                    "Note that the seed provided this way is accessible to unprivileged programs. This functionality should not be used outside of testing environments.");
+ }
+-static void initialize_coredump(bool skip_setup) {
+-#if ENABLE_COREDUMP
+-        if (getpid_cached() != 1)
+-                return;
+-
+-        /* Don't limit the core dump size, so that coredump handlers such as systemd-coredump (which honour the limit)
+-         * will process core dumps for system services by default. */
+-        if (setrlimit(RLIMIT_CORE, &RLIMIT_MAKE_CONST(RLIM_INFINITY)) < 0)
+-                log_warning_errno(errno, "Failed to set RLIMIT_CORE: %m");
+-
+-        /* But at the same time, turn off the core_pattern logic by default, so that no
+-         * coredumps are stored until the systemd-coredump tool is enabled via
+-         * sysctl. However it can be changed via the kernel command line later so core
+-         * dumps can still be generated during early startup and in initramfs. */
+-        if (!skip_setup)
+-                disable_coredumps();
+-#endif
+-}
+-
+ static void initialize_core_pattern(bool skip_setup) {
+         int r;
+@@ -2732,8 +2713,6 @@ int main(int argc, char *argv[]) {
                          kernel_timestamp = DUAL_TIMESTAMP_NULL;
                  }