I'm developing an application that heavily uses the /dev/lirc* nodes via mode2 with popen()/pclose(). If the application doesn't get to shut down cleanly, some lirc device nodes get left open. When I try to use the devices again, i get "mode2: error opening /dev/lirc mode2: Device or resource busy".
1) lsof shows no /dev/lirc* nodes being open.
2) ps -A | grep mode2 yields no results.
3) I don't use lircd so it's not running.
4) rmmod and modprobe'ing won't release the file either.
5) I'm not using the /dev/input/event* device either, only /dev/lirc*.
It's like there's an dangling file handle, or something. The only way I can use it again is to reboot the computer. What's going on and has anyone else had the same problem?