dahdi_cfg: Reduce mass ioctls on non-existing channels

Logic was calling DAHDI_SPECIFY ioctl on all channels up to maximum channel
limit. Added a short circuit to prevent the ioctl on channels that aren't
configured.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
This commit is contained in:
Russ Meyerriecks 2014-07-23 13:20:14 -05:00
parent df47721962
commit 95e9dd71d8

View File

@ -826,8 +826,9 @@ static int apply_fiftysix(void)
int chanfd;
for (x = 1; x < DAHDI_MAX_CHANNELS; x++) {
if (skip_channel(x))
if (skip_channel(x) || !cc[x].sigtype)
continue;
chanfd = open("/dev/dahdi/channel", O_RDWR);
if (chanfd == -1) {
fprintf(stderr,