summaryrefslogtreecommitdiff
path: root/cesar/host
diff options
context:
space:
mode:
authorThierry Carré2013-02-18 19:04:28 +0100
committerThierry Carré2013-02-22 16:45:07 +0100
commitfd0932bb40915df16e8cda735b238fa2eb198750 (patch)
tree2a5fa5add893043e3cc5c8eb6acee669d7bbfea6 /cesar/host
parent668ae87c9040e6ab92244995bff4664295cac7da (diff)
cesar: rename pipe_*_fd fields in station_ctx_t, refs #2979
rename in station_ctx_t : - 'pipe_log_fd' to 'fd_log' - 'pipe_in_fd' to 'fd_in' - 'pipe_out_fd' to 'fd_out'
Diffstat (limited to 'cesar/host')
-rw-r--r--cesar/host/sci/maximus/src/sci.c4
-rw-r--r--cesar/host/station/src/station.c17
-rw-r--r--cesar/host/station/station.h12
3 files changed, 17 insertions, 16 deletions
diff --git a/cesar/host/sci/maximus/src/sci.c b/cesar/host/sci/maximus/src/sci.c
index 0980d9fdb2..ec7552e5ea 100644
--- a/cesar/host/sci/maximus/src/sci.c
+++ b/cesar/host/sci/maximus/src/sci.c
@@ -151,7 +151,7 @@ sci_send (sci_ctx_t *sci, sci_msg_t *msg)
return -1;
}
- output = sci->station->pipe_out_fd;
+ output = sci->station->fd_out;
len = write (output, msg->data_begin, msg->length);
@@ -189,7 +189,7 @@ sci_recv (sci_ctx_t *sci)
return -1;
}
- input = sci->station->pipe_in_fd;
+ input = sci->station->fd_in;
if (sci_msg_init (&msg, sci_buffer, SCI_MSG_MAX_SIZE) < 0)
return -1;
diff --git a/cesar/host/station/src/station.c b/cesar/host/station/src/station.c
index 35a1808fe1..b46000fd4b 100644
--- a/cesar/host/station/src/station.c
+++ b/cesar/host/station/src/station.c
@@ -68,9 +68,9 @@ int station_init(station_ctx_t *station)
memset(station, '\0', sizeof(station_ctx_t));
/* use standard stdin(0), stdout(1), and stderr(2). */
- station->pipe_in_fd = 0;
- station->pipe_out_fd = 1;
- station->pipe_log_fd = 2;
+ station->fd_in = 0;
+ station->fd_out = 1;
+ station->fd_log = 2;
/* get station id */
station->id = getpid();
@@ -157,7 +157,7 @@ int station_idle(station_ctx_t *station)
/* wait for next message with 1 second timeout */
FD_ZERO(&read_fds);
- FD_SET(station->pipe_in_fd, &read_fds);
+ FD_SET (station->fd_in, &read_fds);
timeout.tv_sec = 1;
timeout.tv_usec = 0;
sel = select(STATION_MAX_FD + 1, &read_fds, NULL, NULL, &timeout);
@@ -296,19 +296,20 @@ void station_log(station_ctx_t *station,
strcat(buffer, "<DEBUG> ");
}
hdr_len = strlen(buffer);
- write(station->pipe_log_fd, buffer, hdr_len);
+ write (station->fd_log, buffer, hdr_len);
/* build body and send it */
buffer[STATION_BUFFER_SIZE - 1] = '\0';
va_start(va_args, format);
ret = vsnprintf (buffer, STATION_BUFFER_SIZE - 1, format, va_args);
va_end (va_args);
- write(station->pipe_log_fd, buffer, strlen(buffer));
+ write (station->fd_log, buffer, strlen(buffer));
/* send CR */
if (ret == STATION_MAX_LOG_SIZE)
- write (station->pipe_log_fd, STATION_MAX_LOG_MSG, strlen (STATION_MAX_LOG_MSG));
- write(station->pipe_log_fd, "\n", 1);
+ write (station->fd_log, STATION_MAX_LOG_MSG,
+ strlen (STATION_MAX_LOG_MSG));
+ write (station->fd_log, "\n", 1);
return;
}
diff --git a/cesar/host/station/station.h b/cesar/host/station/station.h
index 9e3af28f96..85a831d3d3 100644
--- a/cesar/host/station/station.h
+++ b/cesar/host/station/station.h
@@ -86,12 +86,12 @@ struct station_ctx
tick_t current_tick_tck;
/** station seed (may be needed for cesar initialization) */
u32 seed;
- /** file descriptor for messaging input pipe */
- int pipe_in_fd;
- /** file descriptor for messaging output pipe */
- int pipe_out_fd;
- /** output pipe file desc to send debug data */
- int pipe_log_fd;
+ /** File descriptor for messaging input. */
+ int fd_in;
+ /** File descriptor for messaging output. */
+ int fd_out;
+ /** Output file descriptor to send debug data. */
+ int fd_log;
station_log_level_t log_level;
unsigned long log_mask;
struct netclock_callback *ecos_tick_cb;