mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 18:59:51 +00:00
[settings] reset the platform settings file descriptor once closed (#10512)
On platform settings deinit, the file descriptor is closed but the variable is not reset, which can lead to calling close on a stale fd leading to bad file descriptor error in case the API is invoked multiple times.
This commit is contained in:
@@ -232,6 +232,7 @@ void otPlatSettingsDeinit(otInstance *aInstance)
|
||||
|
||||
VerifyOrExit(sSettingsFd != -1);
|
||||
VerifyOrDie(close(sSettingsFd) == 0, OT_EXIT_ERROR_ERRNO);
|
||||
sSettingsFd = -1;
|
||||
|
||||
exit:
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user