src/switch_manager/switch.c in trema-0.3.14 vs src/switch_manager/switch.c in trema-0.3.15

- old
+ new

@@ -397,11 +397,11 @@ // TODO: set keepalive-timeout snprintf( new_service_name, new_service_name_len, "%s%#" PRIx64, SWITCH_MANAGER_PREFIX, sw_info->datapath_id ); // checking duplicate service - pid_t pid = get_trema_process_from_name( new_service_name ); + pid_t pid = get_pid_by_trema_name( new_service_name ); if ( pid > 0 ) { // duplicated if ( !terminate_trema_process( pid ) ) { return -1; } @@ -680,10 +680,14 @@ ret = switch_event_connected( &switch_info ); if ( ret < 0 ) { error( "Failed to set connected state." ); return -1; } - flush_secure_channel( &switch_info ); + ret = flush_secure_channel( &switch_info ); + if ( ret < 0 ) { + error( "Failed to flush secure channel. Terminating %s.", argv[ 0 ] ); + return -1; + } start_trema(); finalize_xid_table(); if ( switch_info.cookie_translation ) {