diff --git a/src/coreclr/pal/inc/pal.h b/src/coreclr/pal/inc/pal.h index 05e1deb003e5d0..2f42a2c4fdaf06 100644 --- a/src/coreclr/pal/inc/pal.h +++ b/src/coreclr/pal/inc/pal.h @@ -324,11 +324,7 @@ PAL_IsDebuggerPresent(); #ifndef PAL_STDCPP_COMPAT -#if HOST_64BIT || _MSC_VER >= 1400 typedef __int64 time_t; -#else -typedef long time_t; -#endif #define _TIME_T_DEFINED #endif // !PAL_STDCPP_COMPAT diff --git a/src/coreclr/pal/src/cruntime/misc.cpp b/src/coreclr/pal/src/cruntime/misc.cpp index 4ba36c60a2ada0..7a2690f132233c 100644 --- a/src/coreclr/pal/src/cruntime/misc.cpp +++ b/src/coreclr/pal/src/cruntime/misc.cpp @@ -172,7 +172,12 @@ PAL_time(PAL_time_t *tloc) PERF_ENTRY(time); ENTRY( "time( tloc=%p )\n",tloc ); - result = time(tloc); + time_t t; + result = time(&t); + if (tloc != NULL) + { + *tloc = t; + } LOGEXIT( "time returning %#lx\n",result ); PERF_EXIT(time); diff --git a/src/libraries/Native/Unix/System.Native/pal_random.c b/src/libraries/Native/Unix/System.Native/pal_random.c index b824b2968f95cf..700435afb19b3d 100644 --- a/src/libraries/Native/Unix/System.Native/pal_random.c +++ b/src/libraries/Native/Unix/System.Native/pal_random.c @@ -35,7 +35,7 @@ void SystemNative_GetNonCryptographicallySecureRandomBytes(uint8_t* buffer, int3 if (!sInitializedMRand) { - srand48(time(NULL)); + srand48((long int)time(NULL)); sInitializedMRand = true; }