systemd/0002-logind-0-and-100-should-be-valid-for-UserTasksMax-38.patch

27 lines
980 B
Diff
Raw Normal View History

From 821098286ee773662245254c11ada000ab32fa91 Mon Sep 17 00:00:00 2001
From: Tejun Heo <htejun@fb.com>
Date: Sun, 31 Jul 2016 21:38:47 -0400
Subject: [PATCH] logind: 0% and 100% should be valid for UserTasksMax (#3836)
config_parse_user_tasks_max() was incorrectly accepting percentage value
between 1 and 99. Update it to accept 0% and 100%. This brings it in line
with TasksMax handling in systemd.
(cherry picked from commit cb3e4417590196bd30e1b8097348dca6ba34bd15)
---
src/login/logind-user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index 348e396292..63363035e7 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -893,7 +893,7 @@ int config_parse_user_tasks_max(
/* First, try to parse as percentage */
r = parse_percent(rvalue);
- if (r > 0 && r < 100)
+ if (r >= 0)
k = system_tasks_max_scale(r, 100U);
else {