diff options
author | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-11-25 09:18:59 +0100 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-11-25 09:18:59 +0100 |
commit | 6b3eac36d2fa1e0503217e6a21787ecfb1bc2dae (patch) | |
tree | b7c77217ae71794d9850841acb789e6e01b2598b /src/daemon | |
parent | 5d1256cc1fcf9d47a7bc0e8ac49a9365e7e59915 (diff) | |
download | DLT-daemon-6b3eac36d2fa1e0503217e6a21787ecfb1bc2dae.tar.gz |
Disabled completely SHM if not enabled.
Diffstat (limited to 'src/daemon')
-rwxr-xr-x | src/daemon/dlt-daemon.c | 8 | ||||
-rwxr-xr-x | src/daemon/dlt-daemon.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index dd18d4b..51b7b02 100755 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -594,12 +594,14 @@ int dlt_daemon_local_init_p2(DltDaemon *daemon, DltDaemonLocal *daemon_local, in /* Set flag for optional sending of serial header */ daemon->sendserialheader = daemon_local->flags.lflag; +#ifdef DLT_SHM_ENABLE /* init shared memory */ if (dlt_shm_init_server(&(daemon_local->dlt_shm),DLT_SHM_KEY,daemon_local->flags.sharedMemorySize)==-1) { dlt_log(LOG_ERR,"Could not initialize shared memory\n"); return -1; } +#endif /* prepare main loop */ if (dlt_message_init(&(daemon_local->msg),daemon_local->flags.vflag)==-1) @@ -852,8 +854,10 @@ void dlt_daemon_local_cleanup(DltDaemon *daemon, DltDaemonLocal *daemon_local, i /* Try to delete existing pipe, ignore result of unlink() */ unlink(DLT_USER_FIFO); +#ifdef DLT_SHM_ENABLE /* free shared memory */ dlt_shm_free_server(&(daemon_local->dlt_shm)); +#endif /* Try to delete lock file, ignore result of unlink() */ unlink(DLT_DAEMON_LOCK_FILE); @@ -1249,6 +1253,7 @@ int dlt_daemon_process_user_messages(DltDaemon *daemon, DltDaemonLocal *daemon_l } break; } +#ifdef DLT_SHM_ENABLE case DLT_USER_MESSAGE_LOG_SHM: { if (dlt_daemon_process_user_message_log_shm(daemon, daemon_local, daemon_local->flags.vflag)==-1) @@ -1257,6 +1262,7 @@ int dlt_daemon_process_user_messages(DltDaemon *daemon, DltDaemonLocal *daemon_l } break; } +#endif case DLT_USER_MESSAGE_REGISTER_APPLICATION: { if (dlt_daemon_process_user_message_register_application(daemon, daemon_local, daemon_local->flags.vflag)==-1) @@ -1888,6 +1894,7 @@ int dlt_daemon_process_user_message_log(DltDaemon *daemon, DltDaemonLocal *daemo return 0; } +#ifdef DLT_SHM_ENABLE int dlt_daemon_process_user_message_log_shm(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) { int bytes_to_be_removed=0; @@ -2073,6 +2080,7 @@ int dlt_daemon_process_user_message_log_shm(DltDaemon *daemon, DltDaemonLocal *d return 0; } +#endif int dlt_daemon_process_user_message_set_app_ll_ts(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) { diff --git a/src/daemon/dlt-daemon.h b/src/daemon/dlt-daemon.h index 5d15326..16d7d61 100755 --- a/src/daemon/dlt-daemon.h +++ b/src/daemon/dlt-daemon.h @@ -135,7 +135,9 @@ typedef struct DltReceiver receiverSerial; /**< receiver for serial connection */
int client_connections; /**< counter for nr. of client connections */
size_t baudrate; /**< Baudrate of serial connection */
+#ifdef DLT_SHM_ENABLE
DltShm dlt_shm; /**< Shared memory handling */
+#endif
DltOfflineTrace offlineTrace; /**< Offline trace handling */
} DltDaemonLocal;
@@ -171,7 +173,9 @@ int dlt_daemon_process_user_message_unregister_application(DltDaemon *daemon, Dl int dlt_daemon_process_user_message_register_context(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
int dlt_daemon_process_user_message_unregister_context(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
int dlt_daemon_process_user_message_log(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
+#ifdef DLT_SHM_ENABLE
int dlt_daemon_process_user_message_log_shm(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
+#endif
int dlt_daemon_process_user_message_set_app_ll_ts(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
int dlt_daemon_process_user_message_log_mode(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
|