Fix the core dump by using filesystem error_code

The currently used filesystem method will cause an exception if the
file system is damaged for some reason, resulting in a core dump of
the process.
So the overloaded method with the error_code parameter should be used
here to ensure that the process core dump will not be caused after an
exception is thrown.

Fixes: openbmc/phosphor-bmc-code-mgmt#12

Tested: built phosphor-bmc-code-mgmt successfully and CI passes.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I329f78b481cb466e755bc1b78562583620f561c2
10 files changed