Commit 1d6f8f1d authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Small fixes

parent 319c16f7
......@@ -212,8 +212,7 @@ int trace_packet_write(struct trace *trace, struct trace_pkt *pkt)
r = write(trace->fd, seq, 2);
if (r != 2)
goto err_write;
}
if (i == pkt->len -1) {
} else if (i == pkt->len -1) {
r = write(trace->fd, pkt->data + start, i - start + 1);
if (r != i - start + 1)
goto err_write;
......
......@@ -548,7 +548,7 @@ int main(int argc, char **argv)
tv.tv_sec = 1;
tv.tv_usec = 0;
select(high, &fdset_rx, NULL, NULL, &tv);
select(high + 1, &fdset_rx, NULL, NULL, &tv);
trace_handle(traceval_az, &fdset_rx);
trace_handle(traceval_el, &fdset_rx);
......
......@@ -94,6 +94,7 @@ struct trace_hdl {
struct controller_trace ctrace;
union controller_trace_value last;
union controller_trace_value buffer[TRACE_LEN];
bool valuesend;
};
static int nr_trace_hdl;
......@@ -227,9 +228,10 @@ static void *controller_trace_handle(void *arg)
trace_hdl[i].last.u32 = bufval;
break;
}
if (bufval != last) {
if (bufval != last || !trace_hdl[i].valuesend) {
sendtime = true;
sendval = true;
trace_hdl[i].valuesend = true;
}
}
......@@ -431,6 +433,7 @@ static void *controller_trace_server(void *arg)
trace_hdl[i].added = false;
trace_hdl[i].type = TRACE_INTERVAL_TYPE_INTERVAL;
trace_hdl[i].nsec = -1;
trace_hdl[i].valuesend = false;
trace_hdl[i].free = 0;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment