diff --git a/server/src/file.c b/server/src/file.c index ebee537a3..bb06e2058 100644 --- a/server/src/file.c +++ b/server/src/file.c @@ -109,7 +109,7 @@ int file_open(struct node *n) else { struct msg m; /* Get current time */ - struct timespec now, tmp; + struct timespec now, first, eta; clock_gettime(CLOCK_REALTIME, &now); /* Get timestamp of first sample */ @@ -119,8 +119,8 @@ int file_open(struct node *n) /* Set offset depending on epoch_mode */ switch (f->epoch_mode) { case EPOCH_NOW: /* read first value at f->now + f->epoch */ - tmp = time_diff(&f->start, &now); - f->offset = time_add(&tmp, &f->epoch); + first = time_diff(&f->start, &now); + f->offset = time_add(&first, &f->epoch); break; case EPOCH_RELATIVE: /* read first value at f->start + f->epoch */ f->offset = f->epoch; @@ -130,14 +130,14 @@ int file_open(struct node *n) break; } - tmp = time_add(&f->start, &f->offset); - tmp = time_diff(&now, &tmp); + eta = time_add(&f->start, &f->offset); + eta = time_diff(&now, &eta); - debug(5, "Opened file '%s' as input for node '%s': start=%.2f, offset=%.2f, eta=%.2f", + debug(5, "Opened file '%s' as input for node '%s': start=%.2f, offset=%.2f, eta=%.2f sec", f->path_in, n->name, time_to_double(&f->start), time_to_double(&f->offset), - time_to_double(&tmp) + time_to_double(&eta) ); } } diff --git a/server/src/socket.c b/server/src/socket.c index 8d6e1a0ed..437e13f60 100644 --- a/server/src/socket.c +++ b/server/src/socket.c @@ -241,16 +241,16 @@ int socket_write(struct node *n, struct msg *pool, int poolsize, int first, int struct iovec iov[cnt]; for (int i = 0; i < cnt; i++) { - struct msg *n = &pool[(first+i) % poolsize]; - - if (n->type == MSG_TYPE_EMPTY) + struct msg *m = &pool[(first+i) % poolsize]; + + if (m->type == MSG_TYPE_EMPTY) continue; /* Convert headers to network byte order */ n->sequence = htons(n->sequence); - iov[sent].iov_base = n; - iov[sent].iov_len = MSG_LEN(n); + iov[sent].iov_base = m; + iov[sent].iov_len = MSG_LEN(m); sent++; }