Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[pbctl] Check that device being controlled is a PulseBlaster device
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
  • Loading branch information
mcb30 committed Oct 12, 2010
1 parent 3921d0c commit 391ba8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pbctl/pbctl
Expand Up @@ -93,6 +93,8 @@ GetOptions ( %$opts ) or pod2usage ( "Could not parse command-line options\n" );
pod2usage ( 1 ) unless $program || @$actions;
$device = "/sys/class/pulseblaster/pulseblaster".$device if $device =~ /^\d+$/;
die "Device $device not present\n" unless -d $device;
die "Device $device does not appear to be a PulseBlaster device\n"
unless ( readlink $device."/subsystem" || "" ) =~ /\/pulseblaster$/;

# Program device, if instructed to do so
if ( $program ) {
Expand Down

0 comments on commit 391ba8c

Please sign in to comment.