Author: mjordan
Date: Sun Mar 22 18:55:25 2015
New Revision: 433268

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=433268
Log:
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)

Modified:
    branches/11/apps/app_queue.c

Modified: branches/11/apps/app_queue.c
URL: 
http://svnview.digium.com/svn/asterisk/branches/11/apps/app_queue.c?view=diff&rev=433268&r1=433267&r2=433268
==============================================================================
--- branches/11/apps/app_queue.c (original)
+++ branches/11/apps/app_queue.c Sun Mar 22 18:55:25 2015
@@ -4816,7 +4816,7 @@
 
                        if ((status = get_member_status(qe->parent, 
qe->max_penalty, qe->min_penalty, qe->parent->leavewhenempty, 0))) {
                                *reason = QUEUE_LEAVEEMPTY;
-                               ast_queue_log(qe->parent->name, 
ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, 
qe->opos, (long) time(NULL) - qe->start);
+                               ast_queue_log(qe->parent->name, 
ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, 
qe->opos, (long) (time(NULL) - qe->start));
                                leave_queue(qe);
                                break;
                        }
@@ -5624,7 +5624,7 @@
                        } else if (ast_check_hangup(qe->chan)) {
                                /* Caller must have hung up just before being 
connected */
                                ast_log(LOG_NOTICE, "Caller was about to talk 
to agent on %s but the caller hungup.\n", ast_channel_name(peer));
-                               ast_queue_log(queuename, 
ast_channel_uniqueid(qe->chan), member->membername, "ABANDON", "%d|%d|%ld", 
qe->pos, qe->opos, (long) time(NULL) - qe->start);
+                               ast_queue_log(queuename, 
ast_channel_uniqueid(qe->chan), member->membername, "ABANDON", "%d|%d|%ld", 
qe->pos, qe->opos, (long) (time(NULL) - qe->start));
                                record_abandoned(qe);
                                ast_autoservice_chan_hangup_peer(qe->chan, 
peer);
                                ao2_ref(member, -1);
@@ -5674,7 +5674,7 @@
                /* use  pbx_builtin_setvar to set a load of variables with one 
call */
                if (qe->parent->setqueueentryvar) {
                        snprintf(interfacevar, sizeof(interfacevar), 
"QEHOLDTIME=%ld,QEORIGINALPOS=%d",
-                               (long) time(NULL) - qe->start, qe->opos);
+                               (long) (time(NULL) - qe->start), qe->opos);
                        pbx_builtin_setvar_multiple(qe->chan, interfacevar);
                        pbx_builtin_setvar_multiple(peer, interfacevar);
                }
@@ -5891,7 +5891,7 @@
                        }
                }
                qe->handled++;
-               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), 
member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, 
ast_channel_uniqueid(peer),
+               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), 
member->membername, "CONNECT", "%ld|%s|%ld", (long) (time(NULL) - qe->start), 
ast_channel_uniqueid(peer),
                                                                                
                        (long)(orig - to > 0 ? (orig - to) / 1000 : 0));
 
                if (ast_channel_cdr(qe->chan)) {
@@ -7178,7 +7178,7 @@
                        reason = QUEUE_TIMEOUT;
                        res = 0;
                        ast_queue_log(args.queuename, 
ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld",
-                               qe.pos, qe.opos, (long) time(NULL) - qe.start);
+                               qe.pos, qe.opos, (long) (time(NULL) - 
qe.start));
                        break;
                }
 
@@ -7244,7 +7244,7 @@
                        record_abandoned(&qe);
                        reason = QUEUE_TIMEOUT;
                        res = 0;
-                       ast_queue_log(qe.parent->name, 
ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, 
qe.opos, (long) time(NULL) - qe.start);
+                       ast_queue_log(qe.parent->name, 
ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, 
qe.opos, (long) (time(NULL) - qe.start));
                        break;
                }
 
@@ -7273,7 +7273,7 @@
                                record_abandoned(&qe);
                                ast_queue_log(args.queuename, 
ast_channel_uniqueid(chan), "NONE", "ABANDON",
                                        "%d|%d|%ld", qe.pos, qe.opos,
-                                       (long) time(NULL) - qe.start);
+                                       (long) (time(NULL) - qe.start));
                                res = -1;
                        } else if (qcontinue) {
                                reason = QUEUE_CONTINUE;
@@ -7281,7 +7281,7 @@
                        }
                } else if (qe.valid_digits) {
                        ast_queue_log(args.queuename, 
ast_channel_uniqueid(chan), "NONE", "EXITWITHKEY",
-                               "%s|%d|%d|%ld", qe.digits, qe.pos, qe.opos, 
(long) time(NULL) - qe.start);
+                               "%s|%d|%d|%ld", qe.digits, qe.pos, qe.opos, 
(long) (time(NULL) - qe.start));
                }
        }
 


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to