chiark / gitweb /
logind: update empty and "infinity" handling for [User]TasksMax (#3835)
authorTejun Heo <htejun@fb.com>
Fri, 19 Aug 2016 02:57:53 +0000 (22:57 -0400)
committerSven Eden <yamakuzure@gmx.net>
Wed, 5 Jul 2017 06:50:52 +0000 (08:50 +0200)
commite271d1f29638c009e455a6e06e0865e01cf26f86
tree532e14fd8c06fa3b2fac9404e57099fb6f14dc68
parent0801458c689ba85fd27666f69e42818f87353bc2
logind: update empty and "infinity" handling for [User]TasksMax (#3835)

The parsing functions for [User]TasksMax were inconsistent.  Empty string and
"infinity" were interpreted as no limit for TasksMax but not accepted for
UserTasksMax.  Update them so that they're consistent with other knobs.

* Empty string indicates the default value.
* "infinity" indicates no limit.

While at it, replace opencoded (uint64_t) -1 with CGROUP_LIMIT_MAX in TasksMax
handling.

v2: Update empty string to indicate the default value as suggested by Zbigniew
    JÄ™drzejewski-Szmek.

v3: Fixed empty UserTasksMax handling.
src/basic/cgroup-util.h
src/core/cgroup.c
src/login/logind-user.c