Bug 100538

Summary: gv issues a misleading error message when asked to open zero-sized file
Product: [Fedora] Fedora Reporter: Alexandre Oliva <oliva>
Component: gvAssignee: Dan Williams <dcbw>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-20 03:41:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexandre Oliva 2003-07-23 07:46:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703

Description of problem:
If gv is asked to open a zero-sized file, it says the file does not exist.

Version-Release number of selected component (if applicable):
gv-3.5.8-23

How reproducible:
Always

Steps to Reproduce:
1.create a zero-sized file named foo.ps
  $ > foo.ps
2.Ask gv to open it:
  $ gv foo.ps


Actual Results:  gv: Cannot open file foo.ps (No such file or directory)


Expected Results:  It should open the file and display a blank page, like it
does for a one-blank-line file.

Additional info:

strace seems to indicate it does fine the file, but it's probably not happy that
it has size zero.  When it has non-zero size, the first stat64 is followed by an
open.

stat64("foo.ps", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat64("foo.ps.ps", 0xbff00be0)           = -1 ENOENT (No such file or directory)
stat64("foo.ps", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(2, "gv: Cannot open file foo.ps (No su"..., 56gv: Cannot open file foo.ps
(No such file or directory)
) = 56
exit_group(1)                           = ?

Comment 1 Dan Williams 2004-09-20 03:41:26 UTC
should be fixed in 3.5.8-26 or later