# HG changeset patch # User Stefan Weiser # Date 1272619046 -7200 # Node ID 76d092535367882d4b404706b6804cea3b212606 # Parent 3967e3eb75b0b0fba8cab2fe74ca272b7cf77414 Fixed copying port information. diff -r 3967e3eb75b0 -r 76d092535367 lib/master.c --- a/lib/master.c Fri Apr 30 10:53:56 2010 +0200 +++ b/lib/master.c Fri Apr 30 11:17:26 2010 +0200 @@ -216,7 +216,7 @@ ec_slave_info_t *slave_info) { ec_ioctl_slave_t data; - int index; + int index, i; data.position = slave_position; @@ -232,7 +232,15 @@ slave_info->serial_number = data.serial_number; slave_info->alias = data.alias; slave_info->current_on_ebus = data.current_on_ebus; - strncpy((char*) slave_info->ports, (char*) data.ports, sizeof(slave_info->ports)); + for ( i = 0; i < EC_MAX_PORTS; i++ ) { + slave_info->ports[i].desc = data.ports[i].desc; + slave_info->ports[i].link.link_up = data.ports[i].link.link_up; + slave_info->ports[i].link.loop_closed = data.ports[i].link.loop_closed; + slave_info->ports[i].link.signal_detected = data.ports[i].link.signal_detected; + slave_info->ports[i].receive_time = data.ports[i].receive_time; + slave_info->ports[i].next_slave = data.ports[i].next_slave; + slave_info->ports[i].delay_to_next_dc = data.ports[i].delay_to_next_dc; + } slave_info->al_state = data.al_state; slave_info->error_flag = data.error_flag; slave_info->sync_count = data.sync_count;