const int kApp2sdRetryMax = 5;
const int kApp2sdWaitUsec = 1000000 / 2; // 0.5 sec
+int aul_listen_fd = -1;
+
void SetLanguageEnvironments() {
const char* lang = getenv("LANG");
if (lang == nullptr) {
}
void Util::CloseAllFds(const std::vector<int>& except_fds) {
- int aul_fd = -1;
- const char* aul_listen_fd = getenv("AUL_LISTEN_FD");
- if (aul_listen_fd != nullptr)
- aul_fd = atoi(aul_listen_fd);
+ int aul_fd = aul_listen_fd;
std::vector<int> fds;
try {
socket.SetReceiveBufferSize(Socket::kSocketMaxBufferSize);
socket.SetSendBufferSize(Socket::kSocketMaxBufferSize);
socket.SetCloseOnExec(false);
- int fd = socket.RemoveFd();
- setenv("AUL_LISTEN_FD", std::to_string(fd).c_str(), 1);
+ aul_listen_fd = socket.RemoveFd();
+ setenv("AUL_LISTEN_FD", std::to_string(aul_listen_fd).c_str(), 1);
} catch (const Exception& e) {
_E("Exception occurs. error(%s)", e.what());
return e.GetErrorCode();