Revision: 201002 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Sat, 20 Feb 2010 00:31:00 +0200
branchRCL_3
changeset 3 18f64da82512
parent 0 e4d67989cc36
child 4 0f8d2eb4627b
child 9 fa985af77159
Revision: 201002 Kit: 201007
genericopenlibs/cppstdlib/stl/stlport/stl/_ios.c
genericopenlibs/openenvcore/backend/group/backend.mmp
genericopenlibs/openenvcore/backend/inc/sysif.h
genericopenlibs/openenvcore/backend/src/corebackend/localif.cpp
genericopenlibs/openenvcore/backend/src/corebackend/usocket.cpp
genericopenlibs/openenvcore/libc/src/timefuncs.cpp
genericopenlibs/openenvcore/libpthread/group/libpthread.mmp
genericopenlibs/posixrealtimeextensions/group/librt.mmp
--- a/genericopenlibs/cppstdlib/stl/stlport/stl/_ios.c	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/cppstdlib/stl/stlport/stl/_ios.c	Sat Feb 20 00:31:00 2010 +0200
@@ -110,7 +110,17 @@
   this->imbue(locale());
   this->tie(0);
   this->_M_set_exception_mask(ios_base::goodbit);
-  this->_M_clear_nothrow(__sb != 0 ? ios_base::goodbit : ios_base::badbit);
+  /*
+    this->_M_clear_nothrow(__sb != 0 ? ios_base::goodbit : ios_base::badbit);
+	
+  The ternary expression above, throws an undefined reference link error (for goodbit and badbit)
+  when compiled with GCCE 4.3.2. Replacing ternary statement with an if-else block fixes this.
+  */
+  if(__sb != 0) {
+	this->_M_clear_nothrow(ios_base::goodbit);
+  } else {
+	this->_M_clear_nothrow(ios_base::badbit);
+  }
   ios_base::flags(ios_base::skipws | ios_base::dec);
   ios_base::width(0);
   ios_base::precision(6);
--- a/genericopenlibs/openenvcore/backend/group/backend.mmp	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/openenvcore/backend/group/backend.mmp	Sat Feb 20 00:31:00 2010 +0200
@@ -39,6 +39,8 @@
 USERINCLUDE			../ipcserver/ipccli/inc
 USERINCLUDE			../ipcserver/ipcsrv/inc
 
+// Illegal dependancy on tz.h in MW layer. Needs fixing
+MW_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_LIBC_SYSTEMINCLUDE
 
@@ -146,7 +148,7 @@
 LIBRARY		rpipe.lib
 LIBRARY		charconv.lib
 LIBRARY     estor.lib 
-
+LIBRARY     tzclient.lib 
 
 #ifdef WINSCW
 //wsd solution
--- a/genericopenlibs/openenvcore/backend/inc/sysif.h	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/openenvcore/backend/inc/sysif.h	Sat Feb 20 00:31:00 2010 +0200
@@ -35,6 +35,8 @@
 #include <commdbconnpref.h>
 #include <rpipe.h>
 
+#include<tz.h>
+
 #ifdef SYMBIAN_OE_POSIX_SIGNALS
 #include "signalclient.h"
 #include "tsignalmessage.h"
@@ -112,7 +114,7 @@
 */
 	{
 public:
-	void StorePtrs(RHeap* aHeap, RFs* aFs, RSocketServ* aSs, RCommServ* aCs, RFastLock* aSsLock, RFastLock* aCsLock)
+	void StorePtrs(RHeap* aHeap, RFs* aFs, RSocketServ* aSs, RCommServ* aCs, RFastLock* aSsLock, RFastLock* aCsLock, RTz * aTzs)
 		{
 		iHeap = aHeap;
 		iFs = aFs;
@@ -120,6 +122,7 @@
 		iCs = aCs;
 		iSsLock = aSsLock;
 		iCsLock = aCsLock;
+		iTzS = aTzs;
 		}
 
 	~TCLSICleanup()
@@ -130,6 +133,7 @@
 		iCs->Close();
 		iCsLock->Close();
 		iHeap->Close();
+		iTzS->Close();
 		}
 private:
 	RHeap* iHeap;
@@ -138,6 +142,7 @@
 	RCommServ* iCs;
 	RFastLock* iSsLock;
 	RFastLock* iCsLock;
+	RTz * iTzS;
 	};
 
 
@@ -651,7 +656,7 @@
 	
 	// Default connection settings, set/cleared using setdefaultif
 	TConnPref* iDefConnPref;
-	
+    RTz     iTzServer;	
 #ifdef SYMBIAN_OE_POSIX_SIGNALS
 	// Signal handler thread
 	RThread 				iSignalHandlerThread;
@@ -803,6 +808,11 @@
 	
 #endif // SYMBIAN_OE_POSIX_SIGNALS
 public:
+
+   inline RTz & TZServer()
+        {
+        return iTzServer;
+        } 
 //ipc server session
 RIpcSession iIpcS;
 friend class RFileDesTransferSession;
--- a/genericopenlibs/openenvcore/backend/src/corebackend/localif.cpp	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/openenvcore/backend/src/corebackend/localif.cpp	Sat Feb 20 00:31:00 2010 +0200
@@ -165,13 +165,23 @@
 	        err |= iDefConnLock.CreateLocal();
 			}
 
+        if(err == KErrNone)
+            {
+            err = iTzServer.Connect();
+            if(!err)
+                {
+                err = iTzServer.ShareAuto();
+                }
+            }
+
+
 		//Panic if any of the above operation returns with error
 		if (err)
 			{
 			User::Panic(KEstlibInit, err);
 			}
 
-		iCleanup.StorePtrs(iPrivateHeap, &iFs, &iSs, &iCs, &iSSLock, &iCSLock);
+		iCleanup.StorePtrs(iPrivateHeap, &iFs, &iSs, &iCs, &iSSLock, &iCSLock, &iTzServer);
 		
 		// No connection settings by default
 		iDefConnPref = NULL;
@@ -1600,13 +1610,13 @@
 				{
 				err=iFids.Attach(fd,newf);
 				if (!err)
-					return fd;
-				delete newf;
+					return fd;				
+				newf->Close();
 				}
 			else if(newf != NULL)
 				{
 				//coverity[leave_without_push]
-				delete newf;
+				newf->Close();
 				}
 			iFids.Attach(fd,0);	// cancel the reservation
 			}
--- a/genericopenlibs/openenvcore/backend/src/corebackend/usocket.cpp	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/openenvcore/backend/src/corebackend/usocket.cpp	Sat Feb 20 00:31:00 2010 +0200
@@ -1792,7 +1792,10 @@
 			ret = iSocket.Open(*iSockServPtr,iAddrFamily,iStyle,iProtocol);
 		}
 		}
-	iSocketPtr = &iSocket;
+	if(KErrNone == ret)
+		{
+		iSocketPtr = &iSocket;
+		}
 	iConnectInProgress = EFalse;
 	return ret;
 	}
--- a/genericopenlibs/openenvcore/libc/src/timefuncs.cpp	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/openenvcore/libc/src/timefuncs.cpp	Sat Feb 20 00:31:00 2010 +0200
@@ -162,7 +162,7 @@
     aDate;
     aReference;
 #endif
-
+/*  //This part has been commented out because of performance issue. Also this requires capability.
     if(RProcess().HasCapability(ECapabilityReadUserData,ECapabilityWriteUserData,NULL))
         {
         //          tm_zone updated only in this case. Otherwise always has UTC.
@@ -184,9 +184,12 @@
         CnvUtfConverter::ConvertFromUnicodeToUtf8(ptr,zoneNameDesc);
         CleanupStack::PopAndDestroy(timezone);  
         CleanupStack::PopAndDestroy(localizer);
-        }
-    aTmStruct->tm_zone = tzname[0];
-    }
+        } 
+    
+    aTmStruct->tm_zone = tzname[0]; */
+    
+    aTmStruct->tm_zone = "WILDABBR";
+    }  
 
 void ConvertUtcToLocalTimeL(const time_t* aUTCTime, struct tm* const atmStruct)
     {
@@ -194,7 +197,6 @@
         {
         User::Leave(KErrArgument);
         }
-
     TTime   time(KEpochTime + (*aUTCTime) * (TInt64)1000000);
     TTime   Utime(time);
 
@@ -216,14 +218,11 @@
         return;
         }
 
-    RTz     tzServer;
-    User::LeaveIfError(tzServer.Connect());
-    CleanupClosePushL(tzServer);
-
     TDateTime tdt = time.DateTime();
     
     //enable the cache
-    CTzConverter* ctzConverter = CTzConverter::NewL(tzServer);
+    CTzConverter* ctzConverter = CTzConverter::NewL(Backend()->TZServer());
+    
     CleanupStack::PushL(ctzConverter);
     if(ctzConverter->ConvertToLocalTime(time) == KErrNone)      
         {
@@ -244,10 +243,12 @@
         CleanupStack::PushL(zoneid);
         
         atmStruct->tm_isdst  = -1;
-        UpdateDstAndTznameL(tzServer, *zoneid, atmStruct, time, Utime, tdt, ETzWallTimeReference);
+        UpdateDstAndTznameL(Backend()->TZServer(), *zoneid, atmStruct, time, Utime, tdt, ETzWallTimeReference);
         CleanupStack::PopAndDestroy(zoneid);
         }   
-    CleanupStack::PopAndDestroy(2);
+    
+
+    CleanupStack::PopAndDestroy(1);
     cachetm = *atmStruct;
     }
 
@@ -279,11 +280,8 @@
         return;
         }
 
-    RTz     tzServer;   
-    User::LeaveIfError(tzServer.Connect());
-    CleanupClosePushL(tzServer);    
 
-    CTzConverter* ctzConverter = CTzConverter::NewL(tzServer);      
+    CTzConverter* ctzConverter = CTzConverter::NewL(Backend()->TZServer());      
     CleanupStack::PushL(ctzConverter);
  /* Following fields are updated if successful:
   * tm_wday
@@ -307,17 +305,18 @@
         CleanupStack::PushL(zoneid);
 
         aTmStruct->tm_isdst  = -1;
-        UpdateDstAndTznameL(tzServer, *zoneid, aTmStruct, oldTime, time, tdt, ETzUtcTimeReference);
+        UpdateDstAndTznameL(Backend()->TZServer(), *zoneid, aTmStruct, oldTime, time, tdt, ETzUtcTimeReference);
         CleanupStack::PopAndDestroy(zoneid);
         }
     cachetm = *aTmStruct;
-    CleanupStack::PopAndDestroy(2);
+    CleanupStack::PopAndDestroy(1);
     }
 
 // converts a UTC time to local time, or, local time to UTC time.  
 TInt ConvertTime(const TInt atimeConverFlg, time_t *aUTCTime, struct tm *const atmStruct)
     {
     TInt err = 0;
+
     CActiveScheduler* oldAs = CActiveScheduler::Current();
     RHeap* oldHeap = User::SwitchHeap(Backend()->Heap());
     CActiveScheduler* newAs = new CActiveScheduler();
@@ -335,9 +334,11 @@
         {
         CActiveScheduler::Install(newAs);
         }
-
+    
+    oldHeap = User::SwitchHeap(Backend()->Heap());
     // Cleanup stack needed
     CTrapCleanup* cleanup=CTrapCleanup::New();
+
     if (cleanup)
         {
         if(EUtcToLocal == atimeConverFlg)
@@ -358,7 +359,8 @@
         {
         (void)CActiveScheduler::Replace(oldAs);
         }
-    oldHeap = User::SwitchHeap(Backend()->Heap());
+
+
     delete newAs;
     User::SwitchHeap(oldHeap);
     return MapError(err,errno);
--- a/genericopenlibs/openenvcore/libpthread/group/libpthread.mmp	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/openenvcore/libpthread/group/libpthread.mmp	Sat Feb 20 00:31:00 2010 +0200
@@ -52,6 +52,9 @@
 USERINCLUDE    ../../libc/inc
 USERINCLUDE    ../../backend/inc
 USERINCLUDE     ../../backend/ipcserver/ipccli/inc
+
+// Illegal dependancy on tz.h in MW layer. Needs fixing
+MW_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_LIBC_SYSTEMINCLUDE
 
--- a/genericopenlibs/posixrealtimeextensions/group/librt.mmp	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/posixrealtimeextensions/group/librt.mmp	Sat Feb 20 00:31:00 2010 +0200
@@ -33,6 +33,8 @@
 USERINCLUDE		../../openenvcore/backend/ipcserver/ipccli/inc
 USERINCLUDE		../inc/
 
+// Illegal dependancy on tz.h in MW layer. Needs fixing
+MW_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_LIBC_SYSTEMINCLUDE