Author: zooey Date: 2010-08-03 18:50:28 +0200 (Tue, 03 Aug 2010) New Revision: 37875 Changeset: http://dev.haiku-os.org/changeset/37875 Modified: haiku/trunk/headers/os/kernel/OS.h haiku/trunk/src/system/libroot/os/time.cpp Log: * deprecated set_timezone(), as we no longer support (and need) timezone files Modified: haiku/trunk/headers/os/kernel/OS.h =================================================================== --- haiku/trunk/headers/os/kernel/OS.h 2010-08-03 16:28:32 UTC (rev 37874) +++ haiku/trunk/headers/os/kernel/OS.h 2010-08-03 16:50:28 UTC (rev 37875) @@ -366,12 +366,14 @@ 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 { Modified: haiku/trunk/src/system/libroot/os/time.cpp =================================================================== --- haiku/trunk/src/system/libroot/os/time.cpp 2010-08-03 16:28:32 UTC (rev 37874) +++ haiku/trunk/src/system/libroot/os/time.cpp 2010-08-03 16:50:28 UTC (rev 37875) @@ -57,40 +57,14 @@ 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; }