dahdi: Propagate shutdown returncode to user space.

This change fixes a condition where 'dahdi_cfg -s' would always return
success regardless of whether a board driver was able to complete the
shutdown. Only impacts board drivers that implemented the shutdown span
callback.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9935 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2011-06-02 20:01:10 +00:00
parent cb67046067
commit e8221c04cf

View File

@ -4754,7 +4754,6 @@ static int dahdi_ioctl_shutdown(unsigned long data)
{ {
/* I/O CTL's for control interface */ /* I/O CTL's for control interface */
int j; int j;
int res = 0;
int x; int x;
struct dahdi_span *s; struct dahdi_span *s;
@ -4768,8 +4767,14 @@ static int dahdi_ioctl_shutdown(unsigned long data)
for (x = 0; x < s->channels; x++) for (x = 0; x < s->channels; x++)
s->chans[x]->sig = 0; s->chans[x]->sig = 0;
if (s->ops->shutdown) if (s->ops->shutdown) {
res = s->ops->shutdown(s); int res = s->ops->shutdown(s);
if (res) {
put_span(s);
return res;
}
}
s->flags &= ~DAHDI_FLAG_RUNNING; s->flags &= ~DAHDI_FLAG_RUNNING;
put_span(s); put_span(s);
return 0; return 0;