diff options
author | Lassi Marttala <lassi.lm.marttala@partner.bmw.de> | 2012-05-07 15:36:31 +0200 |
---|---|---|
committer | Christian Muck <christian.muck@bmw.de> | 2012-05-30 09:05:27 +0200 |
commit | e8120186b8ffdbd705d94737c874a6230afdaa2b (patch) | |
tree | 87f5373ee5d73e98bec63a9649f07bf06aa627bf /src/daemon/dlt-daemon.c | |
parent | 33de39a39c5838104d04d08e6eaff8ccb0d0f98d (diff) | |
download | DLT-daemon-e8120186b8ffdbd705d94737c874a6230afdaa2b.tar.gz |
[D4099]: Integrated fix from Alexander Wenzel. This will check for
duplicate file handles, and clean them up if found.
Signed-off-by: Christian Muck <christian.muck@bmw.de>
Diffstat (limited to 'src/daemon/dlt-daemon.c')
-rw-r--r--[-rwxr-xr-x] | src/daemon/dlt-daemon.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index 04612bb..69e4072 100755..100644 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -210,7 +210,7 @@ int option_file_parser(DltDaemonLocal *daemon_local) daemon_local->flags.offlineTraceMaxSize = 0; daemon_local->flags.loggingMode = 0; daemon_local->flags.loggingLevel = 6; - strncpy(daemon_local->flags.loggingFilename,"/tmp/dlt.log",sizeof(daemon_local->flags.loggingFilename)); + strncpy(daemon_local->flags.loggingFilename, DLT_USER_DIR "/dlt.log",sizeof(daemon_local->flags.loggingFilename)); /* open configuration file */ if(daemon_local->flags.cvalue[0]) @@ -974,6 +974,12 @@ int dlt_daemon_process_client_connect(DltDaemon *daemon, DltDaemonLocal *daemon_ dlt_log(LOG_ERR, "accept() failed!\n"); return -1 ; } + + /* check if file file descriptor was already used, and make it invalid if it is reused */ + /* This prevents sending messages to wrong file descriptor */ + dlt_daemon_applications_invalidate_fd(daemon,in_sock,verbose); + dlt_daemon_contexts_invalidate_fd(daemon,in_sock,verbose); + //sprintf("str,"Client Connection from %s\n", inet_ntoa(cli.sin_addr)); //dlt_log(str); FD_SET(in_sock, &(daemon_local->master)); /* add to master set */ |