]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Allow messages with zero id
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 30 Nov 2010 16:35:27 +0000 (17:35 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 30 Nov 2010 16:35:27 +0000 (17:35 +0100)
latester/latester.c

index 85288f75fec923477850ff012cc6ba7f9faecc09..cb578a11ed716ad591198df47fe7b1acb27199fb 100644 (file)
@@ -282,7 +282,7 @@ int send_frame(int socket)
 
        MEMSET_ZERO(frame);
        i = curr_msg+1;
-       while (msg_infos[i].id != 0 && i != curr_msg) {
+       while (msg_infos[i].id != -1 && i != curr_msg) {
                i++;
                if (i >= MAX_INFOS)
                        i = 0;
@@ -310,7 +310,7 @@ int send_frame(int socket)
 
 void msg_info_free(struct msg_info *mi)
 {
-       mi->id = 0;
+       mi->id = -1;
 }
 
 static inline void get_next_timeout(struct timespec *timeout)
@@ -597,7 +597,7 @@ int main(int argc, const char *argv[])
 {
        pthread_t thread;
        sigset_t set;
-       int ret;
+       int ret, i;
 
        parse_options(argc, argv);
 
@@ -606,6 +606,9 @@ int main(int argc, const char *argv[])
        signal(SIGINT, term_handler);
        signal(SIGTERM, term_handler);
 
+       for (i=0; i<MAX_INFOS; i++)
+               msg_infos[i].id = -1;
+
        if (opt.histogram) {
                histogram_init(&histogram, 5000000, 1);
        }