mesh: Fix check for mkdir return value in keyring.c
authorInga Stotland <inga.stotland@intel.com>
Tue, 22 Dec 2020 06:04:08 +0000 (11:34 +0530)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Mon, 28 Dec 2020 06:20:04 +0000 (11:50 +0530)
commit59ef3ef041ad1ec080c54ea2c784f546c73d35b6
tree12818e7a0f47f9ae6c94436de7fbdc14a876034c
parent9fe3398954d7356eec9961ef43b530ee05f436c4
mesh: Fix check for mkdir return value in keyring.c

Remove check for mkdir() return value, since checking for zero does not
cover "already exists" condition and adding extra check for errno value
unnecessarily complicates the code. If mkdir() fails due to any reason
than "already exists", the subsequent call to open() fails and the
error is detected and corectly processed by the code.

Change-Id: I72db1d9553ba9a8269d391f938fbb26abc5cdf50
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
mesh/keyring.c
mesh/mesh.c
mesh/node.c