static void __clear_internal_key(bundle *kb);
static inline void __set_stime(bundle *kb);
-int aul_is_initialized()
+int aul_is_initialized(void)
{
return aul_initialized;
}
return ret;
}
+static int __check_env_pid(void)
+{
+ const char *env_str;
+ int env_pid;
+
+ env_str = getenv("AUL_PID");
+ if (env_str && isdigit(*env_str)) {
+ env_pid = atoi(env_str);
+ if (env_pid != getpid()) {
+ _W("pid(%d) is not equal to AUL_PID(%d)",
+ getpid(), env_pid);
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
static int __get_preinit_fd(void)
{
int fd = -1;
const char *listen_fd;
+ if (__check_env_pid() != 0)
+ return fd;
+
listen_fd = getenv("AUL_LISTEN_FD");
if (listen_fd) {
if (isdigit(*listen_fd))
return fd;
}
-int aul_initialize()
+int aul_initialize(void)
{
int flag;
#include <glib.h>
-int aul_initialize();
-int aul_is_initialized();
+int aul_initialize(void);
+int aul_is_initialized(void);
int aul_app_register_pid(const char *appid, int pid);
int app_send_cmd(int pid, int cmd, bundle *kb);