summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-08-15 04:39:05 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-08-15 04:39:05 +0000
commitdec9d420feb1a505f3a243395937d3b87651afe8 (patch)
tree381673137e4c3ae667ffdff0a0d08d98e83b5b42 /zaptel.c
parentdf10a24eec7570fa1633511eadeeecd932ee5689 (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-xzaptel.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/zaptel.c b/zaptel.c
index 449018b..c775817 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -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);
}