summaryrefslogtreecommitdiff
path: root/kde-frameworks/kinit/files/kinit-5.53.0-systemd-240-soft-rlimit.patch
blob: 3f8823d5b2d5390ce2d605826569ed6e9177d256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 26620aef0bd6d01b543e7523dd15dddc1bb871df Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <ossi@kde.org>
Date: Mon, 24 Dec 2018 14:43:23 +0100
Subject: use soft rlimit for number of open handles

systemd 240 bumped the hard limit from the previous 4k (?) to 1G, which
makes kdeinit essentially lock up at startup.
to get around that, use the soft limit, which matches fd_setsize (1k).
---
 src/kdeinit/kinit.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kdeinit/kinit.cpp b/src/kdeinit/kinit.cpp
index 748bfca..02ab794 100644
--- a/src/kdeinit/kinit.cpp
+++ b/src/kdeinit/kinit.cpp
@@ -165,7 +165,7 @@ static void cleanup_fds()
     int maxfd = FD_SETSIZE;
     struct rlimit rl;
     if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
-        maxfd = rl.rlim_max;
+        maxfd = rl.rlim_cur;
     }
     for (int fd = 3; fd < maxfd; ++fd) {
 #if KDEINIT_OOM_PROTECT
-- 
cgit v1.1