Bug 189216

Summary: Bad return code when compressing 0 length files
Product: Red Hat Enterprise Linux 4 Reporter: David Kovalsky <dkovalsk>
Component: ncompressAssignee: Peter Vrabec <pvrabec>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: medium    
Version: 4.0CC: benl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2006-0663 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-09-12 16:47:17 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:
Bug Depends On:    
Bug Blocks: 201655    
Attachments:
Description Flags
this patch fix both #189215 and #189216 none

Description David Kovalsky 2006-04-18 13:43:50 UTC
Description of problem:
Returns different return code when compressing (actually no compression is done
because the -f parameter was not specified) 0 length files then when compressing
(actually not, because the resulting file is larger, see above) small files.
$ touch foo
$ compress foo
$ echo $?
0

$ echo jkl>bar
$ compress bar
$ echo $?
2

$ ll
-rw-r--r--  1 nfsnobody devqa5 4 Apr 13 04:21 bar
-rw-r--r--  1 nfsnobody devqa5 0 Apr 13 04:18 foo

Same behaviour, different return code. When files are not changed (output is
larger than input) then the return code (according to man pages and behavior in
similar cases) should be 2.

Version-Release number of selected component (if applicable):
ncompress-4.2.4-40
ncompress-4.2.4-41.rhel4

How reproducible:
always

Steps to Reproduce:
1.
$ touch foo
$ compress foo
$ echo $?
0


2.
$ echo jkl>bar
$ compress bar
$ echo $?
2

  
Actual results:
0

Expected results:
2

Additional info:

Comment 1 Peter Vrabec 2006-04-21 12:05:38 UTC
Created attachment 128079 [details]
this patch fix both #189215 and #189216

Comment 10 Red Hat Bugzilla 2006-09-12 16:47:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2006-0663.html