Commit eefc1c47 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

ntdll: Fake success if changing system date is a no-op.

parent 6b055830
...@@ -951,14 +951,21 @@ NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER *NewTime, LARGE_INTEGER *Old ...@@ -951,14 +951,21 @@ NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER *NewTime, LARGE_INTEGER *Old
RtlTimeToSecondsSince1970( NewTime, &sec ); RtlTimeToSecondsSince1970( NewTime, &sec );
/* fake success if time didn't change */
if (oldsec == sec)
return STATUS_SUCCESS;
/* set the new time */ /* set the new time */
tv.tv_sec = sec; tv.tv_sec = sec;
tv.tv_usec = 0; tv.tv_usec = 0;
#ifdef HAVE_SETTIMEOFDAY #ifdef HAVE_SETTIMEOFDAY
tm_t = sec;
if (!settimeofday(&tv, NULL)) /* 0 is OK, -1 is error */ if (!settimeofday(&tv, NULL)) /* 0 is OK, -1 is error */
{
TRACE("OS time changed to %s\n", ctime(&tm_t));
return STATUS_SUCCESS; return STATUS_SUCCESS;
tm_t = sec; }
ERR("Cannot set time to %s, time adjustment %ld: %s\n", ERR("Cannot set time to %s, time adjustment %ld: %s\n",
ctime(&tm_t), (long)(sec-oldsec), strerror(errno)); ctime(&tm_t), (long)(sec-oldsec), strerror(errno));
if (errno == EPERM) if (errno == EPERM)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment