Idefisk
Tools
Tutorials
Reviews
VoIP Providers
Archives
AsteriskGuru Archives
Mailing List Archives
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
[Asterisk-cvs] asterisk/stdtime localtime.c,1.1,1.2
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
View previous topic
::
View next topic
Author
Message
markster at lists.digium.
Guest
Posted: Thu Sep 18, 2003 1:32 pm
Post subject: [Asterisk-cvs] asterisk/stdtime localtime.c,1.1,1.2
Update of /usr/cvsroot/asterisk/stdtime
In directory mongoose.digium.com:/tmp/cvs-serv22928/stdtime
Modified Files:
localtime.c
Log Message:
Grab timezone from system config
Index: localtime.c
===================================================================
RCS file: /usr/cvsroot/asterisk/stdtime/localtime.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- localtime.c 13 Sep 2003 20:51:48 -0000 1.1
+++ localtime.c 18 Sep 2003 13:34:06 -0000 1.2
@@ -650,6 +650,9 @@
register int load_result;
stdname = name;
+#ifdef DEBUG
+ fprintf(stderr, "tzparse(): loading default rules\n");
+#endif
load_result = tzload(TZDEFRULES, sp);
if (load_result != 0)
sp->leapcnt = 0; /* so, we're off a little */
@@ -858,7 +861,14 @@
}
memset(cur_state,0,sizeof(struct state));
if (tzload((char *) NULL, cur_state) != 0)
+#ifdef DEBUG
+ {
+ fprintf(stderr, "ast_tzsetwall: calling gmtload()\n");
+#endif
gmtload(cur_state);
+#ifdef DEBUG
+ }
+#endif
if (last_lclptr)
last_lclptr->next = cur_state;
@@ -920,8 +930,14 @@
cur_state->ttis[0].tt_abbrind = 0;
(void) strcpy(cur_state->chars, gmt);
} else if (tzload(name, cur_state) != 0)
- if (name[0] == ':' || tzparse(name, cur_state, FALSE) != 0)
+ if (name[0] == ':') {
(void) gmtload(cur_state);
+ } else if (tzparse(name, cur_state, FALSE) != 0) {
+ /* If not found, load localtime */
+ if (tzload("/etc/localtime", cur_state) != 0)
+ /* Last ditch, get GMT */
+ (void) gmtload(cur_state);
+ }
strncpy(cur_state->name,name,sizeof(cur_state->name));
if (last_lclptr)
last_lclptr->next = cur_state;
@@ -971,6 +987,18 @@
sp = sp->next;
}
+ if (sp == NULL) {
+ ast_tzsetwall();
+ sp = lclptr;
+ /* Find the default zone record */
+ while (sp != NULL) {
+ if (sp->name[0] == '\0')
+ break;
+ sp = sp->next;
+ }
+ }
+
+ /* Last ditch effort, use GMT */
if (sp == NULL) {
gmtsub(timep, offset, tmp, zone);
return;
Back to top
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
All times are GMT
Page
1
of
1
Jump to:
Select a forum
Asterisk Mailing Lists
----------------
Asterisk-Users
Asterisk-Dev
Asterisk-CVS
Asterisk-Biz
Asterisk-Doc
Asterisk-BSD
Asterisk-Announce
Asterisk Call Centers
Asterisk-Video
Asterisk-Speech-Rec
Bristuff-Users
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
edit your posts in this forum
You
cannot
delete your posts in this forum
You
cannot
vote in polls in this forum
Powered by
phpBB
© 2001, 2005 phpBB Group