* deprecated set_timezone(), as we no longer support (and need) timezone files
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37875 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e70782a501
commit
308ca58d67
@ -366,12 +366,14 @@ extern status_t convert_to_pthread(thread_id thread, pthread_t *_thread);
|
|||||||
extern uint32 real_time_clock(void);
|
extern uint32 real_time_clock(void);
|
||||||
extern void set_real_time_clock(uint32 secsSinceJan1st1970);
|
extern void set_real_time_clock(uint32 secsSinceJan1st1970);
|
||||||
extern bigtime_t real_time_clock_usecs(void);
|
extern bigtime_t real_time_clock_usecs(void);
|
||||||
extern status_t set_timezone(const char *timezone);
|
|
||||||
extern bigtime_t system_time(void);
|
extern bigtime_t system_time(void);
|
||||||
/* time since booting in microseconds */
|
/* time since booting in microseconds */
|
||||||
extern nanotime_t system_time_nsecs();
|
extern nanotime_t system_time_nsecs();
|
||||||
/* time since booting in nanoseconds */
|
/* time since booting in nanoseconds */
|
||||||
|
|
||||||
|
// deprecated (is no-op)
|
||||||
|
extern status_t set_timezone(const char *timezone);
|
||||||
|
|
||||||
/* Alarm */
|
/* Alarm */
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -57,40 +57,14 @@ set_real_time_clock(uint32 secs)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
set_timezone(const char* timezone)
|
set_timezone(const char* /*timezone*/)
|
||||||
{
|
{
|
||||||
char path[B_PATH_NAME_LENGTH];
|
/* There's nothing we can do here, since we no longer support named
|
||||||
status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, -1, true, path,
|
* timezones.
|
||||||
B_PATH_NAME_LENGTH);
|
*
|
||||||
if (status != B_OK) {
|
* TODO: should we keep this around for compatibility or get rid of it?
|
||||||
syslog(LOG_ERR, "can't find settings directory: %s\n", strerror(status));
|
*/
|
||||||
return status;
|
return B_OK;
|
||||||
}
|
|
||||||
|
|
||||||
strlcat(path, "/timezone", sizeof(path));
|
|
||||||
|
|
||||||
if (unlink(path) != 0 && errno != ENOENT) {
|
|
||||||
syslog(LOG_ERR, "can't unlink: %s\n", strerror(errno));
|
|
||||||
return errno;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (symlink(timezone, path) != 0) {
|
|
||||||
syslog(LOG_ERR, "can't symlink: %s\n", strerror(errno));
|
|
||||||
return errno;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isGMT;
|
|
||||||
_kern_get_tzfilename(NULL, 0, &isGMT);
|
|
||||||
_kern_set_tzfilename(timezone, strlen(timezone), isGMT);
|
|
||||||
|
|
||||||
tzset();
|
|
||||||
|
|
||||||
time_t seconds;
|
|
||||||
time(&seconds);
|
|
||||||
struct tm tm;
|
|
||||||
localtime_r(&seconds, &tm);
|
|
||||||
|
|
||||||
return _kern_set_timezone(tm.tm_gmtoff, tm.tm_isdst);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user