chiark / gitweb /
logind: update empty and "infinity" handling for [User]TasksMax (#3835)
[elogind.git] / src / login / logind-user.c
index cd198c8d2623205ae116448897cff284e1ca4710..8a84a8f80d5accd2fb62c971a1bfb1eefc48f497 100644 (file)
@@ -942,7 +942,17 @@ int config_parse_user_tasks_max(
         assert(rvalue);
         assert(data);
 
-        /* First, try to parse as percentage */
+        if (isempty(rvalue)) {
+                *m = system_tasks_max_scale(DEFAULT_USER_TASKS_MAX_PERCENTAGE, 100U);
+                return 0;
+        }
+
+        if (streq(rvalue, "infinity")) {
+                *m = CGROUP_LIMIT_MAX;
+                return 0;
+        }
+
+        /* Try to parse as percentage */
         r = parse_percent(rvalue);
         if (r >= 0)
                 k = system_tasks_max_scale(r, 100U);