clock is now local by default
timezone is now set even if not rtc time setting is found git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10218 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
|
|||||||
char path[B_PATH_NAME_LENGTH];
|
char path[B_PATH_NAME_LENGTH];
|
||||||
char link[B_PATH_NAME_LENGTH];
|
char link[B_PATH_NAME_LENGTH];
|
||||||
FILE *file;
|
FILE *file;
|
||||||
bool isGMT = true;
|
bool isGMT = false;
|
||||||
struct tm* tm = NULL;
|
struct tm* tm = NULL;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
@@ -42,13 +42,14 @@ int main(int argc, char **argv)
|
|||||||
if (file != NULL) {
|
if (file != NULL) {
|
||||||
char string[10];
|
char string[10];
|
||||||
fscanf(file, "%s", string);
|
fscanf(file, "%s", string);
|
||||||
if (strncmp(string, "local", 5) == 0)
|
isGMT = (strncmp(string, "local", 5) != 0);
|
||||||
isGMT = false;
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "%s: can't read RTC settings\n", argv[0]);
|
fprintf(stderr, "%s: can't read RTC settings\n", argv[0]);
|
||||||
printf("%s: No knowledge about contents of RTC\n", argv[0]);
|
printf("%s: No knowledge about contents of RTC\n", argv[0]);
|
||||||
return 0;
|
|
||||||
|
// we don't care if not RTC settings is found, default is local
|
||||||
|
//return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s: RTC stores %s time.\n", argv[0], isGMT ? "GMT" : "local" );
|
printf("%s: RTC stores %s time.\n", argv[0], isGMT ? "GMT" : "local" );
|
||||||
@@ -71,7 +72,6 @@ int main(int argc, char **argv)
|
|||||||
time(&t);
|
time(&t);
|
||||||
tm = localtime(&t);
|
tm = localtime(&t);
|
||||||
_kern_set_tzspecs(tm->tm_gmtoff, tm->tm_isdst);
|
_kern_set_tzspecs(tm->tm_gmtoff, tm->tm_isdst);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "%s: can't read link for timezone\n", argv[0]);
|
fprintf(stderr, "%s: can't read link for timezone\n", argv[0]);
|
||||||
printf("%s: No timezone setting.\n", argv[0]);
|
printf("%s: No timezone setting.\n", argv[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user