From 377eab248877bdf161af4df1186c997371158b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 22 Nov 2004 17:14:06 +0000 Subject: [PATCH] added _user_set_tzfilename moved set_tzfilename into _user_tzfilename git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10177 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/real_time_clock.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/kernel/core/real_time_clock.c b/src/kernel/core/real_time_clock.c index aa47088d89..1083b846b8 100644 --- a/src/kernel/core/real_time_clock.c +++ b/src/kernel/core/real_time_clock.c @@ -144,16 +144,6 @@ real_time_clock_usecs(void) sRealTimeData->timezone_offset; } - -status_t -set_tzspecs(int32 timezone_offset, bool dst_observed) -{ - sRealTimeData->timezone_offset = timezone_offset * 1000000LL; - sRealTimeData->dst_observed = dst_observed; - return B_OK; -} - - // #pragma mark - // public userland API @@ -175,6 +165,24 @@ _user_set_tzspecs(int32 timezone_offset, bool dst_observed) if (geteuid() != 0) return B_NOT_ALLOWED; - set_tzspecs(timezone_offset, dst_observed); + sRealTimeData->timezone_offset = timezone_offset * 1000000LL; + sRealTimeData->dst_observed = dst_observed; return B_OK; } + + +status_t +_user_set_tzfilename(const char *filename, size_t length, bool isGMT) +{ + if (geteuid() != 0) + return B_NOT_ALLOWED; + if (!IS_USER_ADDRESS(filename) + || filename == NULL + || user_strlcpy(sRealTimeData->tzfilename, filename, B_PATH_NAME_LENGTH) < B_OK) + return B_BAD_ADDRESS; + + sRealTimeData->isGMT = isGMT; + + return B_OK; +} +