chiark / gitweb /
logind: 0% and 100% should be valid for UserTasksMax (#3836)
authorTejun Heo <htejun@fb.com>
Mon, 1 Aug 2016 01:38:47 +0000 (21:38 -0400)
committerSven Eden <yamakuzure@gmx.net>
Mon, 19 Jun 2017 07:40:51 +0000 (09:40 +0200)
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 elogind.
(cherry picked from commit cb3e4417590196bd30e1b8097348dca6ba34bd15)

src/login/logind-user.c

index 5c2d9a57c2a9a2a34f5417e3c8273738df0189ea..f24dd618f3263b24dd6884bb0c4a57d604d32ca7 100644 (file)
@@ -936,7 +936,7 @@ int config_parse_user_tasks_max(
 
         /* First, try to parse as percentage */
         r = parse_percent(rvalue);
 
         /* 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 {
 
                 k = system_tasks_max_scale(r, 100U);
         else {