diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-08-15 04:39:05 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-08-15 04:39:05 +0000 |
commit | dec9d420feb1a505f3a243395937d3b87651afe8 (patch) | |
tree | 381673137e4c3ae667ffdff0a0d08d98e83b5b42 /zaptel.c | |
parent | df10a24eec7570fa1633511eadeeecd932ee5689 (diff) |
Bug #91
Can't open /dev/zap/pseudo when no registered spans
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@230 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-x | zaptel.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -2019,13 +2019,16 @@ static int zt_open(struct inode *inode, struct file *file) if (unit == 254) return zt_chan_open(inode, file); if (unit == 255) { - chan = zt_alloc_pseudo(); - if (chan) { - file->private_data = chan; - return zt_specchan_open(inode, file, chan->channo, 1); - } else { + if (maxspans) { + chan = zt_alloc_pseudo(); + if (chan) { + file->private_data = chan; + return zt_specchan_open(inode, file, chan->channo, 1); + } else { + return -ENXIO; + } + } else return -ENXIO; - } } return zt_specchan_open(inode, file, unit, 1); } |