[Build-System] Remove mod_freetdm from spec file, fix compile errors on CentOS

This commit is contained in:
Mike Jerris
2020-08-13 20:45:58 +04:00
committed by Andrey Volk
parent 4dd938f86a
commit cdb4810f8a
4 changed files with 12 additions and 80 deletions
+1
View File
@@ -1340,6 +1340,7 @@ static switch_status_t avmd_parse_cmd_data(avmd_session_t *s, const char *cmd_da
/* iterate over params, check if they mean something to us, set */
idx = 0;
while (idx < argc) {
switch_assert(argv[idx]);
status = avmd_parse_cmd_data_one_entry(argv[idx], &settings);
if (status != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(s->session), SWITCH_LOG_ERROR,
@@ -406,7 +406,7 @@ MONGO_EXPORT int mongo_connect( mongo *conn , const char *host, int port ) {
mongo_init( conn );
conn->primary = bson_malloc( sizeof( mongo_host_port ) );
strncpy( conn->primary->host, host, strlen( host ) + 1 );
strncpy( conn->primary->host, host, sizeof(conn->primary->host) - 1 );
conn->primary->port = port;
conn->primary->next = NULL;
@@ -438,7 +438,7 @@ static void mongo_replset_add_node( mongo_host_port **list, const char *host, in
mongo_host_port *host_port = bson_malloc( sizeof( mongo_host_port ) );
host_port->port = port;
host_port->next = NULL;
strncpy( host_port->host, host, strlen( host ) + 1 );
strncpy( host_port->host, host, sizeof(host_port->host) - 1 );
if( *list == NULL )
*list = host_port;
@@ -618,7 +618,7 @@ MONGO_EXPORT int mongo_replset_connect( mongo *conn ) {
/* Primary found, so return. */
else if( conn->replset->primary_connected ) {
strncpy( conn->primary->host, node->host, strlen( node->host ) + 1 );
snprintf( conn->primary->host, sizeof(conn->primary->host), "%s", node->host );
conn->primary->port = node->port;
return MONGO_OK;
}
@@ -1246,10 +1246,13 @@ MONGO_EXPORT int mongo_find_one( mongo *conn, const char *ns, const bson *query,
}
MONGO_EXPORT void mongo_cursor_init( mongo_cursor *cursor, mongo *conn, const char *ns ) {
size_t len = strlen(ns) + 1;
memset( cursor, 0, sizeof( mongo_cursor ) );
cursor->conn = conn;
cursor->ns = ( const char * )bson_malloc( strlen( ns ) + 1 );
strncpy( ( char * )cursor->ns, ns, strlen( ns ) + 1 );
cursor->ns = ( const char * )bson_malloc( len );
if (cursor->ns) {
strncpy((char *)cursor->ns, ns, len);
}
cursor->current.data = NULL;
}
@@ -202,7 +202,7 @@ int ei_spawn(struct ei_cnode_s *ec, int sockfd, erlang_ref * ref, char *module,
void ei_init_ref(ei_cnode * ec, erlang_ref * ref)
{
memset(ref, 0, sizeof(*ref)); /* zero out the struct */
snprintf(ref->node, MAXATOMLEN, "%s", ec->thisnodename);
snprintf(ref->node, MAXATOMLEN + 1, "%s", ec->thisnodename);
switch_mutex_lock(mod_erlang_event_globals.ref_mutex);
mod_erlang_event_globals.reference0++;