diff options
author | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-11-10 13:42:57 +0100 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-11-10 13:42:57 +0100 |
commit | 3fcd7400a003a3f694f1638a31e3a9fe6cf1595a (patch) | |
tree | 48eed7f9f0387413d1bd63d7f691ae4d15e3a887 /src/daemon/dlt_daemon_common.c | |
parent | d5d9ba55d97d872564e7e271f7ee6c73ec54031b (diff) | |
download | DLT-daemon-3fcd7400a003a3f694f1638a31e3a9fe6cf1595a.tar.gz |
Reverted old FIFO functions. Still SHM enabled by default.
Diffstat (limited to 'src/daemon/dlt_daemon_common.c')
-rwxr-xr-x | src/daemon/dlt_daemon_common.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c index 4877825..aaed7a2 100755 --- a/src/daemon/dlt_daemon_common.c +++ b/src/daemon/dlt_daemon_common.c @@ -187,6 +187,12 @@ int dlt_daemon_init(DltDaemon *daemon,const char *runtime_directory, int verbose dlt_set_id(daemon->ecuid,""); + /* initialize ring buffer for client connection */ + if (dlt_ringbuffer_init(&(daemon->client_ringbuffer), DLT_DAEMON_RINGBUFFER_SIZE)==-1) + { + return -1; + } + return 0; } @@ -2138,8 +2144,16 @@ void dlt_daemon_control_send_control_message( int sock, DltDaemon *daemon, DltMe } else { - /* message can not be sent */ - /* in old implementation control message was stored in buffer */ + /* Store message in history buffer */ + if (dlt_ringbuffer_put3(&(daemon->client_ringbuffer), + msg->headerbuffer+sizeof(DltStorageHeader),msg->headersize-sizeof(DltStorageHeader), + msg->databuffer,msg->datasize, + 0, 0 + )<0) + { + dlt_log(LOG_ERR,"Storage of message in history buffer failed! Message discarded.\n"); + return; + } } } |