From 95e9dd71d8060435a939d936235c4fe807254ac0 Mon Sep 17 00:00:00 2001 From: Russ Meyerriecks Date: Wed, 23 Jul 2014 13:20:14 -0500 Subject: [PATCH] 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 Acked-by: Shaun Ruffell --- dahdi_cfg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dahdi_cfg.c b/dahdi_cfg.c index 432675e..30add83 100644 --- a/dahdi_cfg.c +++ b/dahdi_cfg.c @@ -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,