[mythtv] how do you avoid inheriting file descriptors?

Carlos Talbot mythtv-dev@snowman.net
20 Nov 2002 10:33:41 -0600


I'm experiencing a peculiar problem ever since I began to use the
"ExternalChannelCommand" feature in mythtv. If you remember a few weeks
back I posted a shell & perl script for changing the channel on an AT&T
DCT 2000 box using lirc and an Actisys IR-200L. In order for mythtv to
stay in sync I have to fork off the script as the ir transmission is
relatively slow (1 second delay between each remote code). As a result
while the perl script is running in the background mythtv continues and
tries to secure the bttv device to display/record video. Or at least, it
tries to. The first problem I notice is this:


Changing from WatchingLiveTV to None
changing to 162
Changing from None to RecordingOnly
Can't open video device: /dev/video
open video:: Device or resource busy

Notice the device busy message. What I believe is happening is that the
perl script inherited the open file descriptor for /dev/video. How can I
avoid this? Or for that matter, is there a way I can close this file
descriptor from the child process?

Carlos