Fixed set_timezone()
Added user_shutdown user control Reverted to rtc_boot_time() git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10278 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -57,7 +57,7 @@ rtc_hw_to_system(void)
|
|||||||
|
|
||||||
|
|
||||||
bigtime_t
|
bigtime_t
|
||||||
rtc_system_time_offset(void)
|
rtc_boot_time(void)
|
||||||
{
|
{
|
||||||
return sRealTimeData->system_time_offset;
|
return sRealTimeData->system_time_offset;
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,6 @@ real_time_clock(void)
|
|||||||
bigtime_t
|
bigtime_t
|
||||||
real_time_clock_usecs(void)
|
real_time_clock_usecs(void)
|
||||||
{
|
{
|
||||||
// ToDo: implement me - they might be used directly from libroot/os/time.c
|
|
||||||
return sRealTimeData->system_time_offset + system_time();
|
return sRealTimeData->system_time_offset + system_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,12 +175,12 @@ _user_set_timezone(time_t timezoneOffset, bool daylightSavingTime)
|
|||||||
if (geteuid() != 0)
|
if (geteuid() != 0)
|
||||||
return B_NOT_ALLOWED;
|
return B_NOT_ALLOWED;
|
||||||
|
|
||||||
TRACE(("old system_time_offset %Ld\n", sRealTimeData->system_time_offset));
|
TRACE(("old system_time_offset %Ld old %Ld new %Ld gmt %d\n", sRealTimeData->system_time_offset, sTimezoneOffset, offset, sIsGMT));
|
||||||
|
|
||||||
// We only need to update our time offset if the hardware clock
|
// We only need to update our time offset if the hardware clock
|
||||||
// does not run in the local timezone.
|
// does not run in the local timezone.
|
||||||
// Since this is shared data, we need to update it atomically.
|
// Since this is shared data, we need to update it atomically.
|
||||||
if (sIsGMT)
|
if (!sIsGMT)
|
||||||
atomic_add64(&sRealTimeData->system_time_offset, sTimezoneOffset - offset);
|
atomic_add64(&sRealTimeData->system_time_offset, sTimezoneOffset - offset);
|
||||||
|
|
||||||
sTimezoneOffset = offset;
|
sTimezoneOffset = offset;
|
||||||
|
|||||||
@@ -25,5 +25,8 @@ shutdown(bool reboot)
|
|||||||
status_t
|
status_t
|
||||||
_user_shutdown(bool reboot)
|
_user_shutdown(bool reboot)
|
||||||
{
|
{
|
||||||
|
if (geteuid() != 0)
|
||||||
|
return B_NOT_ALLOWED;
|
||||||
return shutdown(reboot);
|
return shutdown(reboot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ _get_system_info(system_info *info, size_t size)
|
|||||||
// - max_teams
|
// - max_teams
|
||||||
// - used_teams
|
// - used_teams
|
||||||
|
|
||||||
info->boot_time = rtc_system_time_offset();
|
info->boot_time = rtc_boot_time();
|
||||||
info->cpu_count = smp_get_num_cpus();
|
info->cpu_count = smp_get_num_cpus();
|
||||||
info->used_ports = port_used_ports();
|
info->used_ports = port_used_ports();
|
||||||
info->max_ports = port_max_ports();
|
info->max_ports = port_max_ports();
|
||||||
|
|||||||
Reference in New Issue
Block a user