summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2012-06-27 15:21:27 +0200
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2012-11-26 12:38:48 +0100
commitda99dde7401fce0d9a844ea7881ce7b1208547e0 (patch)
treebf24330548ecaca00d6aa3cb02fe65c1ba16ee02
parenta89488791439111f73e31bc42c1de760b7e967ef (diff)
downloadDLT-daemon-da99dde7401fce0d9a844ea7881ce7b1208547e0.tar.gz
Do not register appliction again, if already registered.
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
-rwxr-xr-xsrc/lib/dlt_user.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c
index 7135e39..958c9eb 100755
--- a/src/lib/dlt_user.c
+++ b/src/lib/dlt_user.c
@@ -455,6 +455,35 @@ int dlt_register_app(const char *appid, const char * description)
return -1;
}
+ /* check if application already registered */
+ /* if yes do not register again */
+ if(appid[1]==0)
+ {
+ if(appid[0]==dlt_user.appID[0])
+ return 0;
+ }
+ else if(appid[2]==0)
+ {
+ if(appid[0]==dlt_user.appID[0] &&
+ appid[1]==dlt_user.appID[1])
+ return 0;
+ }
+ else if(appid[3]==0)
+ {
+ if(appid[0]==dlt_user.appID[0] &&
+ appid[1]==dlt_user.appID[1] &&
+ appid[2]==dlt_user.appID[2])
+ return 0;
+ }
+ else
+ {
+ if(appid[0]==dlt_user.appID[0] &&
+ appid[1]==dlt_user.appID[1] &&
+ appid[2]==dlt_user.appID[2] &&
+ appid[3]==dlt_user.appID[3])
+ return 0;
+ }
+
DLT_SEM_LOCK();
/* Store locally application id and application description */