dahdi_cfg: Wait for all spans to be assigned.
authorShaun Ruffell <sruffell@digium.com>
Mon, 9 Dec 2013 23:19:23 +0000 (17:19 -0600)
committerShaun Ruffell <sruffell@digium.com>
Thu, 12 Dec 2013 15:08:51 +0000 (09:08 -0600)
commit5ca600c7c79e8d10d63dd2703b3902b4c4548eb5
tree0ac8bb0b198b5b41f3c4623f50f5b71a4cc87625
parent98736e1add0064f654c630b5268e3a53804c503c
dahdi_cfg: Wait for all spans to be assigned.

When auto span assignment is disabled, it's possible that simply running

  # /etc/init.d/dahdi restart

Will fail since dahdi_cfg can run in parallel with udev scripts that are
assigning spans, which results in /etc/dahdi/system.conf describing spans that
do not exist in the system.

This change sets up dahdi_cfg, when run without the -C or -S options, to look in
sysfs and make sure all spans for each device are assigned.  dahdi_cfg will wait
5 seconds for span assignment to happen before proceeding normally.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
dahdi_cfg.c