for(;;) {
memset(buf, 0, sizeof(buf));
- r = sdb_read(fd_in, buf, sizeof(buf));
+ r = sdb_read(fd_in, buf, sizeof(buf)-1);
if (r == 0) {
break;
} else if(r < 0) {
args[2] = p_info->shell_cmd;
ptm_fd = create_subprocess(SHELL_COMMAND, &pid, (char * const*)args, (char * const*)envp);
- D("create_subprocess() ptm_fd=%d pid=%d\n", ptm_fd, pid);
if (ptm_fd < 0) {
D("cannot create service thread\n");
return -1;
}
+ D("create_subprocess() ptm_fd=%d pid=%d\n", ptm_fd, pid);
if (p_info->receiver_func != NULL) {
p_info->receiver_func(ptm_fd, p_info->fd);
char path_file[PATH_MAX] = {0, };
struct tm now;
time_t t;
-// char value[PROPERTY_VALUE_MAX];
- char* p_trace = get_sdb_log_conf("SDB_TRACE");
- char* p_path = get_sdb_log_conf("SDBD_LOG_PATH");
+
// read the trace mask from persistent property persist.sdb.trace_mask
// give up if the property is not set or cannot be parsed
-
+ char* p_trace = get_sdb_log_conf("SDB_TRACE");
if ((p_trace == NULL ) && !is_enable_sdbd_log()) {
return;
} else {
free(p_trace);
}
-
+ char* p_path = get_sdb_log_conf("SDBD_LOG_PATH");
if (p_path) {
snprintf(path_folder, sizeof(path_folder), "%s", p_path);
free(p_path);
- } else if (g_capabilities.log_path[0] != '\0')
+ } else if (g_capabilities.log_path[0] != '\0') {
snprintf(path_folder, sizeof(path_folder), "%s", g_capabilities.log_path);
- else
+ } else {
return;
+ }
tzset();
time(&t);
} control_un;
ssize_t ret;
+ memset(&msg, 0, sizeof(msg));
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof(control_un.control);
char control[CMSG_SPACE(sizeof(int))];
} control_un;
+ memset(&msg, 0, sizeof(msg));
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof(control_un.control);
t->connection_state = CS_PWLOCK;
}
}
+ put_apacket(ap);
}
}
sdb_mutex_unlock(&transport_lock);