Gracefully handle ENODEV in sdcard daemon (part deux)
reorder to handle errno correctly and remove log stutter Bug: 22197797 Bug: 22241640 Change-Id: I81e6b2ff15b6ea6e5e780bd3599bf1019ff36f26
This commit is contained in:
parent
a65e402b61
commit
6b6c1bd996
1 changed files with 3 additions and 5 deletions
|
@ -1513,16 +1513,14 @@ static void handle_fuse_requests(struct fuse_handler* handler)
|
|||
{
|
||||
struct fuse* fuse = handler->fuse;
|
||||
for (;;) {
|
||||
ssize_t len = read(fuse->fd,
|
||||
handler->request_buffer, sizeof(handler->request_buffer));
|
||||
ssize_t len = TEMP_FAILURE_RETRY(read(fuse->fd,
|
||||
handler->request_buffer, sizeof(handler->request_buffer)));
|
||||
if (len < 0) {
|
||||
if (errno != EINTR) {
|
||||
ERROR("[%d] handle_fuse_requests: errno=%d\n", handler->token, errno);
|
||||
}
|
||||
if (errno == ENODEV) {
|
||||
ERROR("[%d] someone stole our marbles!\n", handler->token);
|
||||
exit(2);
|
||||
}
|
||||
ERROR("[%d] handle_fuse_requests: errno=%d\n", handler->token, errno);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue