copy-blockdev: Fix to handle error case first 33/314633/3 accepted/tizen/unified/20240718.143635 accepted/tizen/unified/x/20240719.012643
authorSangYoun Kwak <sy.kwak@samsung.com>
Tue, 16 Jul 2024 11:47:02 +0000 (20:47 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Thu, 18 Jul 2024 01:50:39 +0000 (10:50 +0900)
commit210f7a10b8c8623819f6217339048a2cd4d27ea0
tree148d2cb5094560432ec4ba4281ce25a425a1f1a8
parentf3477d6560448c0a60fb6e421feede5ea6ef605e
copy-blockdev: Fix to handle error case first

The previous code works ok but it can be lead to the reader
misunderstand its behavior.
To make it clear that error case is handled, some codes are rearranged.
Also, to clarify the error handling and flow of the code, switch
statement is replaced to if statement.

Change-Id: I65de34aab245c20ba3b6869cea1931edf99594d5
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
src/copy-blockdev/lib.c