summaryrefslogtreecommitdiffstats
path: root/btif/src/btif_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'btif/src/btif_core.c')
-rw-r--r--btif/src/btif_core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index 6db10762c..ba717bb48 100644
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
@@ -29,6 +29,7 @@
#include <ctype.h>
#include <cutils/properties.h>
#include <dirent.h>
+#include <errno.h>
#include <fcntl.h>
#include <hardware/bluetooth.h>
#include <stdlib.h>
@@ -413,10 +414,10 @@ static void btif_fetch_local_bdaddr(bt_bdaddr_t *local_addr)
BTIF_TRACE_DEBUG("%s, local bdaddr is stored in %s", __func__, val);
- if ((addr_fd = open(val, O_RDONLY)) != -1)
+ if ((addr_fd = TEMP_FAILURE_RETRY(open(val, O_RDONLY))) != -1)
{
memset(val, 0, sizeof(val));
- read(addr_fd, val, FACTORY_BT_BDADDR_STORAGE_LEN);
+ TEMP_FAILURE_RETRY(read(addr_fd, val, FACTORY_BT_BDADDR_STORAGE_LEN));
/* If this is not a reserved/special bda, then use it */
if ((string_to_bdaddr(val, local_addr)) &&
(memcmp(local_addr->address, null_bdaddr, BD_ADDR_LEN) != 0))