DD_LIST_FOREACH(cond_head[next], elem, n) {
diff = difftime(now, n->time);
ctime_r(&n->time, buf);
+ buf[strlen(buf) - 1] = 0;
if (diff > LOCK_TIME_WARNING) {
if (diff > LOCK_TIME_WARNING * 60 && n->pid < INTERNAL_LOCK_BASE && n->broadcast_warning) {
pm_history_log[index].log_type >= PM_LOG_MAX)
continue;
ctime_r(&pm_history_log[index].time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
snprintf(buf, sizeof(buf), "[%3d] %15s %3d %s",
index,
history_string[pm_history_log[index].log_type],
DD_LIST_FOREACH(cond_head[s_index], elem, t) {
get_pname((pid_t)t->pid, pname);
ctime_r(&t->time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
snprintf(buf, sizeof(buf),
" %d: [%s] locked by pid %d %s %s",
i++, states[s_index].name, t->pid, pname, time_buf);
time(&now_time);
ctime_r(&now_time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd != -1) {
DD_LIST_FOREACH(cond_head[next], elem, n) {
diff = difftime(now, n->time);
ctime_r(&n->time, buf);
+ buf[strlen(buf) - 1] = 0;
if (diff > LOCK_TIME_WARNING) {
if (diff > LOCK_TIME_WARNING * 60 && n->pid < INTERNAL_LOCK_BASE && n->broadcast_warning) {
pm_history_log[index].log_type >= PM_LOG_MAX)
continue;
ctime_r(&pm_history_log[index].time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
snprintf(buf, sizeof(buf), "[%3d] %15s %3d %s",
index,
history_string[pm_history_log[index].log_type],
DD_LIST_FOREACH(cond_head[s_index], elem, t) {
get_pname((pid_t)t->pid, pname);
ctime_r(&t->time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
snprintf(buf, sizeof(buf),
" %d: [%s] locked by pid %d %s %s",
i++, states[s_index].name, t->pid, pname, time_buf);
time(&now_time);
ctime_r(&now_time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd != -1) {
DD_LIST_FOREACH(cond_head[next], elem, n) {
diff = difftime(now, n->time);
ctime_r(&n->time, buf);
+ buf[strlen(buf) - 1] = 0;
if (diff > LOCK_TIME_WARNING) {
if (diff > LOCK_TIME_WARNING * 60 && n->pid < INTERNAL_LOCK_BASE && n->broadcast_warning) {
pm_history_log[index].log_type >= PM_LOG_MAX)
continue;
ctime_r(&pm_history_log[index].time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
snprintf(buf, sizeof(buf), "[%3d] %15s %3d %s",
index,
history_string[pm_history_log[index].log_type],
DD_LIST_FOREACH(cond_head[s_index], elem, t) {
get_pname((pid_t)t->pid, pname);
ctime_r(&t->time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
snprintf(buf, sizeof(buf),
" %d: [%s] locked by pid %d %s %s",
i++, states[s_index].name, t->pid, pname, time_buf);
time(&now_time);
ctime_r(&now_time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd != -1) {
DD_LIST_FOREACH(cond_head[next], elem, n) {
diff = difftime(now, n->time);
ctime_r(&n->time, buf);
+ buf[strlen(buf) - 1] = 0;
if (diff > LOCK_TIME_WARNING) {
if (diff > LOCK_TIME_WARNING * 60 && n->pid < INTERNAL_LOCK_BASE && n->broadcast_warning) {
pm_history_log[index].log_type >= PM_LOG_MAX)
continue;
ctime_r(&pm_history_log[index].time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
snprintf(buf, sizeof(buf), "[%3d] %15s %3d %s",
index,
history_string[pm_history_log[index].log_type],
DD_LIST_FOREACH(cond_head[s_index], elem, t) {
get_pname((pid_t)t->pid, pname);
ctime_r(&t->time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
snprintf(buf, sizeof(buf),
" %d: [%s] locked by pid %d %s %s",
i++, states[s_index].name, t->pid, pname, time_buf);
time(&now_time);
ctime_r(&now_time, time_buf);
+ time_buf[strlen(time_buf) - 1] = 0;
fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd != -1) {
cur_time = get_time();
ctime_r(&cur_time, cur_buf);
+ cur_buf[strlen(cur_buf) - 1] = 0;
snprintf(buf, sizeof(buf), "current time : %s\n", cur_buf);
ret = write(fd, buf, strlen(buf));
if (ret < 0)
if (info->locktime) {
ctime_r(&info->locktime, lock_buf);
+ lock_buf[strlen(lock_buf) - 1] = 0;
tmp = strchr(lock_buf, '\n');
if (!tmp)
continue;
}
if (info->unlocktime) {
ctime_r(&info->unlocktime, unlock_buf);
+ unlock_buf[strlen(unlock_buf) - 1] = 0;
tmp = strchr(unlock_buf, '\n');
if (!tmp)
continue;
ts2 = localtime_r(&now, &ts);
if (ts2) {
asctime_r(&ts, buf);
+ buf[strlen(buf) - 1] = 0;
_D("Current local time is %s.", buf);
}
ts2 = localtime_r(&now, &ts);
if (ts2) {
asctime_r(&ts, buf);
+ buf[strlen(buf) - 1] = 0;
_D("New local time is %s.", buf);
}
return 0;