while (host) {
g_strstrip(host);
- if (strncmp(module_name, host, strlen(module_name) + 1) == 0) {
+ if (strncmp(module_name, host, strlen(module_name)) == 0) {
module_name_matched = true;
*module_index = idx;
break;
r = realpath(path, NULL);
if (r) {
- if (strncmp(r, path, strlen(path) + 1) != 0) {
+ if (strncmp(r, path, strlen(path)) != 0) {
LOGW("symbolic link exists [%s] -> [%s]", path, r);
unlink(path);
}
Name: mused
Summary: A multimedia daemon
-Version: 0.3.135
+Version: 0.3.136
Release: 0
Group: System/Libraries
License: Apache-2.0
str = _ms_config_get_str(conf->muse_dict, MUSE_LOG, NULL);
if (str) {
- if (strncmp(str, MUSE_USE_LOG, strlen(MUSE_USE_LOG) + 1) == 0)
+ if (strncmp(str, MUSE_USE_LOG, strlen(MUSE_USE_LOG)) == 0)
conf->log_enabled = TRUE;
else
conf->log_enabled = FALSE;
muse_return_if_fail(conf);
muse_return_if_fail(conf->host_infos);
- for (idx = 0; idx <= conf->host_cnt; idx++) {
- MUSE_FREE(conf->host_infos[conf->host_cnt]->path);
- MUSE_FREE(conf->host_infos[conf->host_cnt]->preloaded);
- MUSE_FREE(conf->host_infos[conf->host_cnt]);
+ for (idx = 0; idx < conf->host_cnt; idx++) {
+ MUSE_FREE(conf->host_infos[idx]->path);
+ MUSE_FREE(conf->host_infos[idx]->preloaded);
+ MUSE_FREE(conf->host_infos[idx]);
MUSE_FREE(conf->host[idx]);
}
while (fgets(log_buf, MUSE_MSG_LEN_MAX, fp)) {
label = strtok_r(log_buf, delimiter, &ptr);
if (label) {
- if (strncmp(label, BUILD_ID, strlen(BUILD_ID) + 1) == 0) {
+ if (strncmp(label, BUILD_ID, strlen(BUILD_ID)) == 0) {
value = strtok_r(NULL, delimiter, &ptr);
if (value)
ms_log_write(value);
LOGI("server : %d client [%s channel] : %d", server_sockfd, channel_name[channel], client_sockfd);
pid = _ms_get_pid(client_sockfd);
+ if (pid == -1) {
+ close(client_sockfd);
+ _ms_unlock_state();
+ return FALSE;
+ }
+
if (channel == MUSE_CHANNEL_MSG) {
m = g_new0(muse_module_t, 1);
close(server_sockfd);
close(client_sockfd);
- if (m) {
- if (channel == MUSE_CHANNEL_MSG)
- g_free(m);
- else
- muse_core_connection_close(m->ch[MUSE_CHANNEL_MSG].sock_fd);
- }
+ if (m)
+ muse_core_connection_close(m->ch[MUSE_CHANNEL_MSG].sock_fd);
_ms_unlock_state();
close(fds[0]);
/* Parent process closes up output side of pipe */
- if (!strcmp(msg, MSG_DONE)) {
+ if (!strncmp(msg, MSG_DONE, strlen(MSG_DONE))) {
LOGI("Successfully daemonized");
exit(EXIT_SUCCESS);
} else {
trace_begin("MUSE:preloading module");
#endif
for (idx = 0; idx < ms_config_get_host_cnt(); idx++) {
- if (0 == strncmp(ms_config_get_preloaded_value(idx), "yes", strlen("yes") + 1)) {
+ if (0 == strncmp(ms_config_get_preloaded_value(idx), "yes", strlen("yes"))) {
g_module_symbol(ms_module_open(idx), CMD_DISPATCHER, (gpointer *)&cmd_dispatcher);
if (cmd_dispatcher && cmd_dispatcher[MUSE_MODULE_COMMAND_INITIALIZE])
cmd_dispatcher[MUSE_MODULE_COMMAND_INITIALIZE](NULL);
g_mutex_init(&watchdog->lock);
g_cond_init(&watchdog->cond);
+
+ g_mutex_lock(&watchdog->lock);
watchdog->run = TRUE;
+ g_mutex_unlock(&watchdog->lock);
return MM_ERROR_NONE;
}