mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07: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:
+2
-1
@@ -296,7 +296,8 @@ void cgroup_init(uev_ctx_t *ctx)
|
||||
group_init(FINIT_CGPATH "/system", 0, "cpu.weight:9800");
|
||||
|
||||
/* 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 */
|
||||
fd = iwatch_init(&iw_cgroup);
|
||||
|
||||
Reference in New Issue
Block a user