mirror of
https://github.com/troglobit/finit.git
synced 2026-10-29 12:40:44 +00:00
cgroup: check return value from fnwrite(), found by Coverity Scan
We check it everywhere else, and a log message for failing to move PID 1 to the init cgroup is useful as well. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
3b495d7518
commit
4e6b9514d5
1 file changed
+2
-1
+2
-1
@@ -296,7 +296,8 @@ void cgroup_init(uev_ctx_t *ctx)
|
|||||||
group_init(FINIT_CGPATH "/system", 0, "cpu.weight:9800");
|
group_init(FINIT_CGPATH "/system", 0, "cpu.weight:9800");
|
||||||
|
|
||||||
/* Move ourselves to init (best effort, otherwise run in 'root' group */
|
/* Move ourselves to init (best effort, otherwise run in 'root' group */
|
||||||
fnwrite("1", FINIT_CGPATH "/init/cgroup.procs");
|
if (fnwrite("1", FINIT_CGPATH "/init/cgroup.procs"))
|
||||||
|
_pe("Failed moving PID 1 to cgroup ", FINIT_CGPATH "/init");
|
||||||
|
|
||||||
/* prepare cgroup.events watcher */
|
/* prepare cgroup.events watcher */
|
||||||
fd = iwatch_init(&iw_cgroup);
|
fd = iwatch_init(&iw_cgroup);
|
||||||
|
|||||||
Reference in new issue
Block a user