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