persistentstorage/dbms/tdbms/t_dbbug.cpp
changeset 55 44f437012c90
parent 40 b8bdbc8f59c7
equal deleted inserted replaced
51:7d4490026038 55:44f437012c90
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   357 
   357 
   358 void Defect_COMBBAR_463J5D::KillDbmsServer()
   358 void Defect_COMBBAR_463J5D::KillDbmsServer()
   359     {
   359     {
   360     _LIT(KDbmsServer,"edbsrv.exe");
   360     _LIT(KDbmsServer,"edbsrv.exe");
   361      TFullName name;
   361      TFullName name;
   362     //RDebug::Print(_L("Find and kill \"%S\" process.\n"), &aProcessName);
       
   363     TBuf<64> pattern(KDbmsServer);
   362     TBuf<64> pattern(KDbmsServer);
   364     TInt length = pattern.Length();
   363     TInt length = pattern.Length();
   365     pattern += _L("*");
   364     pattern += _L("*");
   366     TFindProcess procFinder(pattern);
   365     TFindProcess procFinder(pattern);
   367 
   366 
   374                 c == TChar('_') ||
   373                 c == TChar('_') ||
   375                 c == TChar('-'))
   374                 c == TChar('-'))
   376                 {
   375                 {
   377                 // If the found name is other valid application name
   376                 // If the found name is other valid application name
   378                 // starting with aProcessName string.
   377                 // starting with aProcessName string.
   379                 //RDebug::Print(_L(":: Process name: \"%S\".\n"), &name);
       
   380                 continue;
   378                 continue;
   381                 }
   379                 }
   382             }
   380             }
   383         RProcess proc;
   381         RProcess proc;
   384         if (proc.Open(name) == KErrNone)
   382         if (proc.Open(name) == KErrNone)
   385             {
   383             {
   386             proc.Kill(0);
   384             proc.Kill(0);
   387             //RDebug::Print(_L("\"%S\" process killed.\n"), &name);
       
   388             }
   385             }
   389         proc.Close();
   386         proc.Close();
   390         }
   387         }
   391     }
   388     }
   392 
   389 
   591 	if(err == KErrNone)
   588 	if(err == KErrNone)
   592 		{
   589 		{
   593 		TEntry entry;
   590 		TEntry entry;
   594 		if(fsSession.Entry(aFullName, entry) == KErrNone)
   591 		if(fsSession.Entry(aFullName, entry) == KErrNone)
   595 			{
   592 			{
   596 			RDebug::Print(_L("Deleting \"%S\" file.\n"), &aFullName);
   593 			test.Printf(_L("Deleting \"%S\" file.\n"), &aFullName);
   597 			err = fsSession.SetAtt(aFullName, 0, KEntryAttReadOnly);
   594 			err = fsSession.SetAtt(aFullName, 0, KEntryAttReadOnly);
   598 			if(err != KErrNone)
   595 			if(err != KErrNone)
   599 				{
   596 				{
   600 				RDebug::Print(_L("Error %d changing \"%S\" file attributes.\n"), err, &aFullName);
   597 				test.Printf(_L("Error %d changing \"%S\" file attributes.\n"), err, &aFullName);
   601 				}
   598 				}
   602 			err = fsSession.Delete(aFullName);
   599 			err = fsSession.Delete(aFullName);
   603 			if(err != KErrNone)
   600 			if(err != KErrNone)
   604 				{
   601 				{
   605 				RDebug::Print(_L("Error %d deleting \"%S\" file.\n"), err, &aFullName);
   602 				test.Printf(_L("Error %d deleting \"%S\" file.\n"), err, &aFullName);
   606 				}
   603 				}
   607 			}
   604 			}
   608 		fsSession.Close();
   605 		fsSession.Close();
   609 		}
   606 		}
   610 	else
   607 	else
   611 		{
   608 		{
   612 		RDebug::Print(_L("Error %d connecting file session. File: %S.\n"), err, &aFullName);
   609 		test.Printf(_L("Error %d connecting file session. File: %S.\n"), err, &aFullName);
   613 		}
   610 		}
   614 	}
   611 	}
   615 
   612 
   616 GLDEF_C TInt E32Main()
   613 GLDEF_C TInt E32Main()
   617 //
   614 //