Bug in pri_find_principle
authorMatthew Fredrickson <creslin@digium.com>
Mon, 23 May 2005 17:07:32 +0000 (17:07 +0000)
committerMatthew Fredrickson <creslin@digium.com>
Mon, 23 May 2005 17:07:32 +0000 (17:07 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5755 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index f90b48a..de9f0f4 100755 (executable)
@@ -7337,7 +7337,9 @@ static int pri_find_principle(struct zt_pri *pri, int channel)
        
        if (!PRI_EXPLICIT(channel)) {
                spanfd = pri_active_dchan_fd(pri);
-               span = ioctl(spanfd, ZT_GET_PARAMS, &param);
+               if (ioctl(spanfd, ZT_GET_PARAMS, &param))
+                       return -1;
+               span = param.spanno - 1;
        }
 
        for (x=0;x<pri->numchans;x++) {