do { \
const char *tmp; \
struct timeval tv; \
+ int ret; \
tmp = bundle_get_val(kb, AUL_K_STARTTIME); \
- if (tmp != NULL) \
- sscanf(tmp, "%ld/%ld", &tv.tv_sec, &tv.tv_usec); \
- else \
+ if (tmp != NULL) { \
+ ret = sscanf(tmp, "%ld/%ld", &tv.tv_sec, &tv.tv_usec); \
+ if (ret != 2) \
+ printf("Failed to convert format\n"); \
+ } else { \
gettimeofday(&tv, NULL); \
+ } \
__g_base_time.tv_sec = tv.tv_sec; \
__g_base_time.tv_usec = tv.tv_usec; \
} while (0)
timersub(&cur, &__g_base_time, &res); \
printf("%c[1;31m[%s,%d] %ld sec %ld msec " \
fmt" %c[0m\n", \
- 27, __FUNCTION__, __LINE__, \
+ 27, __func__, __LINE__, \
res.tv_sec, res.tv_usec/1000, \
##arg, 27); \
} \
sun_size = sizeof(struct sockaddr_un);
- if ((*clifd = accept(fd, (struct sockaddr *)&aul_addr,
- (socklen_t *)&sun_size)) == -1) {
+ *clifd = accept(fd, (struct sockaddr *)&aul_addr,
+ (socklen_t *)&sun_size);
+ if (*clifd == -1) {
if (errno != EINTR)
_E("accept error");
return NULL;
if (ret <= 0) {
close(fd);
return -1;
- } else {
- buf[ret] = 0;
}
+ buf[ret] = 0;
close(fd);
return ret;
if (kill(ret, SIGKILL) == -1)
_E("Failed to send SIGKILL: %d", errno);
}
-
- return;
}
static int __prepare_exec(const char *appid, const char *app_path,
/* SET PRIVILEGES */
_D("appid: %s / pkg_type: %s / app_path: %s",
appid, appinfo->pkg_type, app_path);
- if ((ret = _set_access(appid)) != 0) {
+ ret = _set_access(appid);
+ if (ret != 0) {
_E("Failed to set privileges "
"- check your package's credential: %d", ret);
return -1;
static int gdbserver_pid = -1;
static int gdbserver_app_pid = -1;
-static bool gdbserver = false;
-static int valgrind_option = 0;
+static bool gdbserver;
+static int valgrind_option;
bool _gdbserver_is_running(void)
{
{
struct stat st;
char dir[PATH_MAX];
+ int n;
if (path == NULL)
return -1;
return -1;
if (strrchr(path, '/') != NULL) {
- int n = strlen(path)-strlen(strrchr(path, '/'));
+ n = strlen(path) - strlen(strrchr(path, '/'));
if (n >= PATH_MAX)
return -1;
#define AUL_DBUS_APPDEAD_SIGNAL "app_dead"
#define AUL_DBUS_APPLAUNCH_SIGNAL "app_launch"
-static GDBusConnection *bus = NULL;
+static GDBusConnection *bus;
static sigset_t oldmask;
static void __socket_garbage_collector(void)