Gracefully handle ENODEV in sdcard daemon.
When someone force-unmounts our target endpoint, gracefully handle by
terminating, instead of looping on the same errno forever.
Bug: 22197797
Change-Id: I7e71632f69d47152ea78a94431c23ae69aba9b93
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c
index a136232..3cd5bc4 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -1510,6 +1510,10 @@
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);
+ }
continue;
}