todbot/blink1 — pull request #35 by mjbrooks (2013-01-01 22:18:04+00:00)
Title: Slight change to the way the video device use is determined

The original CAM=`lsof $CAMERA` worked fine until I found out
that Bodhi Linux (and therefore perhaps others) returned quite
a few processes. So we are more acurate with this test and are
looking specifically for the 'mem' File Descriptor (FD) being
listed in the return of lsof

Tested on: Ubuntu 12.04, 12.10 and Bodhi 2.1.0

For reference. here's the output of lsof on Bodhi Linux with the
webcam in use as indicated by the 4th entry where the FD column
shows 'mem':

mjbrooks@dharma: ~ $ lsof /dev/video0
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
enlighten 2642 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
nm-applet 2710 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
pithos 2711 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
skype 2712 mjbrooks mem CHR 81,0 10634 /dev/video0
skype 2712 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
skype 2712 mjbrooks 66u CHR 81,0 0t0 10634 /dev/video0
remmina 2713 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
enlighten 2722 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
terminolo 5005 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
chrome 6618 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
chrome 6623 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0
terminolo 8241 mjbrooks 13r CHR 81,0 0t0 10634 /dev/video0

It's not entirely clear why it's retuning these on Bodhi when Ubuntu
does not since Bodhi Linux is based on Ubuntu. Perhaps it's just
how e17 does things.