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 | |
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
-rwxr-xr-x | Makefile | 5 | ||||
-rwxr-xr-x | zaptel.c | 15 |
2 files changed, 13 insertions, 7 deletions
@@ -87,7 +87,7 @@ DEVFS=$(shell ps ax | grep -v grep | grep devfsd) TZOBJS=zonedata.lo tonezone.lo LIBTONEZONE=libtonezone.so.1.0 MODULES=zaptel.o tor2.o torisa.o wcusb.o wcfxo.o wcfxs.o \ - ztdynamic.o ztd-eth.o wct1xxp.o wct4xxp.o # ztdummy.o + ztdynamic.o ztd-eth.o wct1xxp.o wct4xxp.o wcs3200p.o # ztdummy.o #MODULES+=wcfxsusb.o ZTTOOL=$(shell if [ -f /usr/include/newt.h ]; then echo zttool; fi) #PRIMARY=wcfxsusb @@ -127,6 +127,9 @@ wct4xxp.o:wct4xxp.c zaptel.h wcfxs.o:wcfxs.c zaptel.h gcc $(KFLAGS) -c wcfxs.c +wcs3200p.o:wcs3200p.c zaptel.h + gcc $(KFLAGS) -c wcs3200p.c + ztdummy.o:ztdummy.c ztdummy.h gcc $(KFLAGS) -c ztdummy.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); } |