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:
Jérôme Duval
2004-11-28 23:13:22 +00:00
parent 384bba914c
commit bfb2692a61
3 changed files with 7 additions and 5 deletions
+3 -4
View File
@@ -57,7 +57,7 @@ rtc_hw_to_system(void)
bigtime_t
rtc_system_time_offset(void)
rtc_boot_time(void)
{
return sRealTimeData->system_time_offset;
}
@@ -141,7 +141,6 @@ real_time_clock(void)
bigtime_t
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();
}
@@ -176,12 +175,12 @@ _user_set_timezone(time_t timezoneOffset, bool daylightSavingTime)
if (geteuid() != 0)
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
// does not run in the local timezone.
// Since this is shared data, we need to update it atomically.
if (sIsGMT)
if (!sIsGMT)
atomic_add64(&sRealTimeData->system_time_offset, sTimezoneOffset - offset);
sTimezoneOffset = offset;
+3
View File
@@ -25,5 +25,8 @@ shutdown(bool reboot)
status_t
_user_shutdown(bool reboot)
{
if (geteuid() != 0)
return B_NOT_ALLOWED;
return shutdown(reboot);
}
+1 -1
View File
@@ -38,7 +38,7 @@ _get_system_info(system_info *info, size_t size)
// - max_teams
// - used_teams
info->boot_time = rtc_system_time_offset();
info->boot_time = rtc_boot_time();
info->cpu_count = smp_get_num_cpus();
info->used_ports = port_used_ports();
info->max_ports = port_max_ports();