stif/TestServer/src/TestServerClient.cpp
changeset 17 67c6ff54ec25
parent 13 33016869e0dd
child 32 8f8df8006c40
equal deleted inserted replaced
15:ccab7f1f8266 17:67c6ff54ec25
   118         return ret;
   118         return ret;
   119         }
   119         }
   120     do
   120     do
   121         {
   121         {
   122         semName.Format(_L("%S%d"), &semaphoreName, x);
   122         semName.Format(_L("%S%d"), &semaphoreName, x);
       
   123         if (semName.Length() > KMaxKernelName)
       
   124             {
       
   125             // if the cfg file name is larger than maximum length of acceptable length of semaphore .
       
   126             RDebug::Print(_L("Test Module name or Configuration File name is too long."));
       
   127             
       
   128             semName.Close();
       
   129             return KErrBadName;
       
   130             }
       
   131         
   123         ret = startSemaphore.CreateGlobal(semName, 0);
   132         ret = startSemaphore.CreateGlobal(semName, 0);
   124         RDebug::Print(_L("RTestServer::Connect() Creating global semaphore [%S] with result [%d]"), &semName, ret);
   133         RDebug::Print(_L("RTestServer::Connect() Creating global semaphore [%S] with result [%d]"), &semName, ret);
   125         if(ret != KErrAlreadyExists)
   134         if(ret != KErrAlreadyExists)
   126             {
   135             {
   127             semaphoreName.Copy(semName);
   136             semaphoreName.Copy(semName);
   151     RProcess pr;
   160     RProcess pr;
   152 
   161 
   153     // Data to be passed to new process. It will contain module name and synchronization semaphore name separated with space.
   162     // Data to be passed to new process. It will contain module name and synchronization semaphore name separated with space.
   154     // I.e. it will be: "mymodule startupSemaphore0"
   163     // I.e. it will be: "mymodule startupSemaphore0"
   155     RBuf data; 
   164     RBuf data; 
   156     ret = data.Create(KMaxName);
   165     ret = data.Create(KMaxFileName);
   157     if(ret != KErrNone)
   166     if(ret != KErrNone)
   158         {
   167         {
   159         RDebug::Print(_L("RTestServer::Connect() Could not create buffer for data to be passed to process [%d]"), ret);
   168         RDebug::Print(_L("RTestServer::Connect() Could not create buffer for data to be passed to process [%d]"), ret);
   160         return ret;
   169         return ret;
   161         }
   170         }