Bug 486061 - dvgrab incorrect exit status: exit status is zero even if cannot successfully capture
dvgrab incorrect exit status: exit status is zero even if cannot successfully...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: dvgrab (Show other bugs)
rawhide
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Jarod Wilson
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-17 22:03 EST by Arnav
Modified: 2009-03-19 16:34 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-03-19 16:34:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Arnav 2009-02-17 22:03:23 EST
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 10:57:38 EST
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 16:27:22 EDT
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 16:31:01 EDT
Created attachment 335929 [details]
Set proper retval on error condition
Comment 4 Jarod Wilson 2009-03-19 16:34:06 EDT
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.