Bug 486061 - dvgrab incorrect exit status: exit status is zero even if cannot successfully capture
Summary: dvgrab incorrect exit status: exit status is zero even if cannot successfully...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dvgrab
Version: rawhide
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jarod Wilson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-18 03:03 UTC by Arnav
Modified: 2009-03-19 20:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-19 20:34:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Set proper retval on error condition (767 bytes, patch)
2009-03-19 20:31 UTC, Jarod Wilson
no flags Details | Diff

Description Arnav 2009-02-18 03:03:23 UTC
Description of problem:

dvgrab terminates with a zero exit code (success) even when it can't actually successfully capture.  If you write a script that calls on dvgrab, and you want that script to react to dvgrab failure to capture, it is important for dvgrab to terminate with an exit code which depicts whether the operation was successful or not.  Not having the right exit code returned, makes it very difficult to wrap and use dvgrab within another program.  

How reproducible: always


Steps to Reproduce:
1.  Make sure a firewire video device is not actually connected to the machine!  
2.  Call dvgrab from within a script knowing it would fail for example:  
    perl -e 'print system("dvgrab")'
  
Actual results:
dvgrab outputs "Error: no camera exists" but the actual exit code is zero:
-----------------------------
[root@localhost ~]# perl -e 'print system("dvgrab")'
Error: no camera exists

0
----------------------------

Expected results:
exit code other than zero.

Additional info:
the full dvgrab command I am using is:
"dvgrab -noavc -nostop -format=jpeg -jpeg-quality=100 -jpeg-over -d smpte=1 image.jpg"

Comment 1 Arnav 2009-02-18 15:57:38 UTC
Adding versions:
dvgrab 3.2

Linux fc11 2.6.29-0.66.rc3.fc11.i586 #1 SMP Thu Jan 29 14:43:51 EST 2009 i686 i686 i386 GNU/Linux

Comment 2 Jarod Wilson 2009-03-19 20:27:22 UTC
Issue is still present in dvgrab 3.4, but I've just slapped a quick patch in on top of it and will build dvgrab-3.4-2.fc11 shortly, which in local testing, seems to do the trick:

$ dvgrab
Error: no camera exists

$ echo $?
1

I'll send the patch upstream as well.

Comment 3 Jarod Wilson 2009-03-19 20:31:01 UTC
Created attachment 335929 [details]
Set proper retval on error condition

Comment 4 Jarod Wilson 2009-03-19 20:34:06 UTC
Build completed, can go here to find a copy.

http://koji.fedoraproject.org/koji/taskinfo?taskID=1250275

Should end up in the actual rawhide tree sometime after the f11 beta freeze is over, I believe.


Note You need to log in before you can comment on or make changes to this bug.