LOG(VERBOSE) << "Waiting for FUSE to spin up...";
usleep(50000); // 50ms
}
+ /* sdcardfs will have exited already. FUSE will still be running */
+ TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG));
return OK;
}
return -1;
}
- if (setsockopt(mSock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0) {
- SLOGE("Unable to set uevent socket SO_RCVBUFFORCE option: %s", strerror(errno));
+ // When running in a net/user namespace, SO_RCVBUFFORCE is not available.
+ // Try using SO_RCVBUF first.
+ if ((setsockopt(mSock, SOL_SOCKET, SO_RCVBUF, &sz, sizeof(sz)) < 0) &&
+ (setsockopt(mSock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0)) {
+ SLOGE("Unable to set uevent socket SO_RCVBUF/SO_RCVBUFFORCE option: %s", strerror(errno));
goto out;
}
LOG(VERBOSE) << "Waiting for FUSE to spin up...";
usleep(50000); // 50ms
}
+ /* sdcardfs will have exited already. FUSE will still be running */
+ TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG));
return OK;
}