return fd;
}
+void WriteStatusToIdFile(int status) {
+ const char* env_str = getenv("AUL_APPID");
+ if (env_str == nullptr) {
+ if (getuid() >= REGULAR_UID_MIN)
+ _W("Failed to get AUL_APPID");
+
+ return;
+ }
+
+ std::string path = "/run/aul/apps/" + std::to_string(getuid()) + "/" +
+ std::to_string(getpid()) + "/" + std::string(env_str);
+ FILE* fp = fopen(path.c_str(), "w");
+ if (fp == nullptr) {
+ _E("fopen() is failed. path(%s), errno(%d)", path.c_str(), errno);
+ return;
+ }
+
+ fprintf(fp, "%d", status);
+ fclose(fp);
+}
+
} // namespace
extern "C" int aul_is_initialized() {
return AUL_R_ECOMM;
}
}
+ WriteStatusToIdFile(1);
aul_notify_start();
aul_initialized = 1;