aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_zap.c')
-rwxr-xr-xchannels/chan_zap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index f90b48a09..de9f0f4c1 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -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++) {