info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cvs diff exit status


From: Noel L Yap
Subject: Re: [PATCH] cvs diff exit status
Date: Fri, 1 Dec 2000 10:36:06 -0500

The exit status of "cvs diff" is exactly the same as the exit status of "diff"
(man diff for more info).  Why not test the exit status itself:
cvs diff blah
if [ $? -lt 2 ]
then
     echo success
else
     echo failure
fi




address@hidden on 2000.12.01 09:59:07

To:   address@hidden
cc:   (bcc: Noel L Yap)
Subject:  [PATCH] cvs diff exit status




When the cvs diff command is run it attempts to return one of
three status codes to main:

0 - files same
1 - files different
2 - Some sort of error has occurred

main interprets and return codes > 0 as a cvs program failure.
I've changed diff.c to return only success or failure.  Success
is either the '0' or '1' state outlined above.  Failure is the
'2' state.

The reason that I have done this is because the current cvs
code returns EXIT_FAILURE for both '1' and '2' outlined above.
When I run a cvs diff command and check the programs return code
I have no way of telling whether cvs ran successfully or cvs found
some diffs without parsing the output from cvs as well.

Thanks!

donald


Attachment: fix_diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]