mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
small fixes
This commit is contained in:
parent
08678c8785
commit
08f7dd5b25
4 changed files with 6 additions and 6 deletions
|
@ -12,8 +12,6 @@
|
|||
#ifndef _FILE_H_
|
||||
#define _FILE_H_
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "node.h"
|
||||
|
||||
struct file {
|
||||
|
|
|
@ -167,7 +167,7 @@ int config_parse_path(config_setting_t *cfg,
|
|||
list_push(paths, p);
|
||||
}
|
||||
else {
|
||||
char buf[33];
|
||||
char buf[128];
|
||||
path_print(p, buf, sizeof(buf));
|
||||
|
||||
warn("Path %s is not enabled", buf);
|
||||
|
|
|
@ -27,7 +27,7 @@ int file_print(struct node *n, char *buf, int len)
|
|||
{
|
||||
struct file *f = n->file;
|
||||
|
||||
return snprintf(buf, len, "in=%s, out=%s, mode=%s, rate=%f",
|
||||
return snprintf(buf, len, "in=%s, out=%s, mode=%s, rate=%.1f",
|
||||
f->path_in, f->path_out, f->mode, f->rate);
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ int file_read(struct node *n, struct msg *pool, int poolsize, int first, int cnt
|
|||
if (f->in) {
|
||||
/* Blocking for 1/f->rate seconds */
|
||||
if (timerfd_wait(f->tfd)) {
|
||||
for (i=0; i<cnt; i++) {
|
||||
for (i = 0; i < cnt; i++) {
|
||||
struct msg *m = &pool[(first+i) % poolsize];
|
||||
|
||||
msg_fscan(f->in, m);
|
||||
|
@ -121,7 +121,7 @@ int file_write(struct node *n, struct msg *pool, int poolsize, int first, int cn
|
|||
struct file *f = n->file;
|
||||
|
||||
if (f->out) {
|
||||
for (i=0; i<cnt; i++) {
|
||||
for (i = 0; i < cnt; i++) {
|
||||
struct msg *m = &pool[(first+i) % poolsize];
|
||||
|
||||
msg_fprint(f->out, m);
|
||||
|
|
|
@ -69,8 +69,10 @@ static void * path_run(void *arg)
|
|||
|
||||
/* Allocate memory for message pool */
|
||||
p->pool = alloc(p->poolsize * sizeof(struct msg));
|
||||
p->previous = p->current = p->pool;
|
||||
|
||||
/* Open deferred TCP connection
|
||||
TODO: fix this
|
||||
node_start_defer(p->in);
|
||||
|
||||
FOREACH(&p->destinations, it)
|
||||
|
|
Loading…
Add table
Reference in a new issue