mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	Fix compilations errors on 64-bit OpenBSD systems
In versiong 5.5, OpenBSD went to 64-bit time values. This requires a cast to (long) when printing members of certain time structs. Review: https://reviewboard.asterisk.org/r/4507 ASTERISK-24879 #close Reported by: snuffy Tested by: snuffy patches: openbsd-time64.diff uploaded by snuffy (License 5024) ........ Merged revisions 433268 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433269 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		@@ -284,14 +284,16 @@ static void cdr_read_callback(void *data, struct stasis_subscription *sub, struc
 | 
			
		||||
			struct timeval fmt_time;
 | 
			
		||||
			struct ast_tm tm;
 | 
			
		||||
			/* tv_usec is suseconds_t, which could be int or long */
 | 
			
		||||
			long int tv_sec;
 | 
			
		||||
			long int tv_usec;
 | 
			
		||||
 | 
			
		||||
			if (sscanf(tempbuf, "%ld.%ld", &fmt_time.tv_sec, &tv_usec) != 2) {
 | 
			
		||||
			if (sscanf(tempbuf, "%ld.%ld", &tv_sec, &tv_usec) != 2) {
 | 
			
		||||
				ast_log(AST_LOG_WARNING, "Unable to parse %s (%s) from the CDR for channel %s\n",
 | 
			
		||||
					args.variable, tempbuf, ast_channel_name(payload->chan));
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
			if (fmt_time.tv_sec) {
 | 
			
		||||
			if (tv_sec) {
 | 
			
		||||
				fmt_time.tv_sec = tv_sec;
 | 
			
		||||
				fmt_time.tv_usec = tv_usec;
 | 
			
		||||
				ast_localtime(&fmt_time, &tm, NULL);
 | 
			
		||||
				ast_strftime(tempbuf, sizeof(tempbuf), "%Y-%m-%d %T", &tm);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user