diff --git a/headers/os/kernel/OS.h b/headers/os/kernel/OS.h index fe2151ea35..c534de9347 100644 --- a/headers/os/kernel/OS.h +++ b/headers/os/kernel/OS.h @@ -366,12 +366,14 @@ extern status_t convert_to_pthread(thread_id thread, pthread_t *_thread); extern uint32 real_time_clock(void); extern void set_real_time_clock(uint32 secsSinceJan1st1970); extern bigtime_t real_time_clock_usecs(void); -extern status_t set_timezone(const char *timezone); extern bigtime_t system_time(void); /* time since booting in microseconds */ extern nanotime_t system_time_nsecs(); /* time since booting in nanoseconds */ + // deprecated (is no-op) +extern status_t set_timezone(const char *timezone); + /* Alarm */ enum { diff --git a/src/system/libroot/os/time.cpp b/src/system/libroot/os/time.cpp index 86184bc95b..97a34a9bcc 100644 --- a/src/system/libroot/os/time.cpp +++ b/src/system/libroot/os/time.cpp @@ -57,40 +57,14 @@ set_real_time_clock(uint32 secs) status_t -set_timezone(const char* timezone) +set_timezone(const char* /*timezone*/) { - char path[B_PATH_NAME_LENGTH]; - status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, -1, true, path, - B_PATH_NAME_LENGTH); - if (status != B_OK) { - syslog(LOG_ERR, "can't find settings directory: %s\n", strerror(status)); - return status; - } - - 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); + /* There's nothing we can do here, since we no longer support named + * timezones. + * + * TODO: should we keep this around for compatibility or get rid of it? + */ + return B_OK; }