genericopenlibs/openenvcore/libc/src/libc_init/estlib.cpp
changeset 44 97b0fb8a2cc2
parent 0 e4d67989cc36
child 57 2efc27d87e1c
equal deleted inserted replaced
22:ddc455616bd6 44:97b0fb8a2cc2
   109 // This API is used for get path of private directory of user
   109 // This API is used for get path of private directory of user
   110 // -----------------------------------------------------------------------------
   110 // -----------------------------------------------------------------------------
   111 //
   111 //
   112 void GetTmpDirName()
   112 void GetTmpDirName()
   113 {
   113 {
   114 	TFileName file;	
   114 	TFileName file;
       
   115 	TInt r = KErrNone;
   115 	RFs iTestSession;
   116 	RFs iTestSession;
   116 	TBuf8<PATH_MAX> buf1;
   117 	TBuf8<PATH_MAX> buf1;
   117 	TInt len;
   118 	TInt len;
   118 	file.Append(iTestSession.GetSystemDriveChar());
   119 	file.Append(iTestSession.GetSystemDriveChar());
   119 	file.Append(TChar(KDriveDelimiter));
   120 	file.Append(TChar(KDriveDelimiter));
   122 	__tmpdirptr = (char*)Backend()->Alloc(PATH_MAX);
   123 	__tmpdirptr = (char*)Backend()->Alloc(PATH_MAX);
   123 	if(__tmpdirptr == NULL)
   124 	if(__tmpdirptr == NULL)
   124 	{
   125 	{
   125 		User::Panic(_L("LIBRARY-INIT"), KErrNoMemory);
   126 		User::Panic(_L("LIBRARY-INIT"), KErrNoMemory);
   126 	}
   127 	}
   127 	iTestSession.Connect();		
   128 	r = iTestSession.Connect(); 
       
   129     if (r != KErrNone)
       
   130         {
       
   131             User::Panic(_L("Connect failed"), r);
       
   132         }
   128 	iTestSession.SessionPath(file);		
   133 	iTestSession.SessionPath(file);		
   129 	buf1.Copy(file);
   134 	buf1.Copy(file);
   130 	iTestSession.Close();
   135 	iTestSession.Close();
   131 	
   136 	
   132 	len=buf1.Length();
   137 	len=buf1.Length();