locationmanager/client/src/rlocationmanager.cpp
branchRCL_3
changeset 63 e538444823de
parent 47 b73252188534
--- a/locationmanager/client/src/rlocationmanager.cpp	Wed Sep 15 12:40:59 2010 +0300
+++ b/locationmanager/client/src/rlocationmanager.cpp	Wed Oct 13 15:02:02 2010 +0300
@@ -33,31 +33,19 @@
     {
     LOG( "RLocationManager::LaunchServer begin" );
 
-    TFindServer findLocServer( KLocServerName );
-    TFullName name;
+    // DLL launch
+    RProcess server;
+    TInt ret = server.Create( KLocServerFileName, KNullDesC );
 
-    TInt result = findLocServer.Next( name );
-    if ( result == KErrNone )
+    if ( ret != KErrNone )  // Loading failed.
         {
-        LOG( "StartServer() - Server already running" );
-        
-        // Server already running
-        return KErrNone;
+        return ret;
         }
     
-    RProcess server;
-    result = server.Create( KLocServerFileName, KNullDesC );   
-    if ( result != KErrNone )
-        {
-        LOG1( "CreateServerProcess() - failed to create server process, error: %d", result );
-        return result;
-        }
- 
-    // Process created successfully
-    TRequestStatus stat( KErrNone );
-    server.Rendezvous( stat );
-    
-    if ( stat != KRequestPending )
+    TRequestStatus status( KErrNone );
+    server.Rendezvous( status );
+
+    if ( status != KRequestPending )
         {
         LOG( "RLocationManager::LaunchServer Failed" );
         server.Kill( 0 );     // Abort startup.
@@ -66,17 +54,15 @@
         {
         server.Resume();    // Logon OK - start the server.
         }
-    
-    User::WaitForRequest( stat ); // wait for start or death
+        
+    User::WaitForRequest( status ); // wait for start or death
     // we can't use the 'exit reason' if the server panicked as this
     // is the panic 'reason' and may be '0' wehich cannot be distinguished
     // from KErrNone
-    result = ( server.ExitType() == EExitPanic ) ? KErrCommsBreak : stat.Int();
+    ret = ( server.ExitType() == EExitPanic ) ? KErrCommsBreak : status.Int();
     server.Close();
-    
     LOG( "RLocationManager::LaunchServer end" );
-    
-    return result;       
+    return ret;    
     }
 
 // --------------------------------------------------------------------------