]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api: cg_move_task_files() - rearrange code to avoid extra check
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Sat, 8 Jul 2023 14:49:55 +0000 (20:19 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 17 Jul 2023 17:15:15 +0000 (11:15 -0600)
commit487b23439e681a764e8ec6f45b89e7847f3832f4
tree9ff0a093a05e11506a1162912c17b70bd6f8c9a8
parent0bc52ba6fda08f55d21a7d44db57126b119f874f
api: cg_move_task_files() - rearrange code to avoid extra check

Fix unused variables, reported by the Coverity tool:

CID 320878 (#1 of 1): Unused value (UNUSED_VALUE)assigned_value:
Assigning value 0 to ret here, but that stored value is overwritten
before it can be used.

Currently, in cg_move_task_files(), the ret is checked for ESRCH and set
to zero, if true, and for other error values it executes the error path
but immediately the ret is over-written without reading the set zero,
re-arrange the code to such that only the error path is executed and ret
is not set to zero.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c