[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog diff.c
From: |
Derek Robert Price |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog diff.c |
Date: |
Tue, 16 Sep 2008 22:39:51 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Changes by: Derek Robert Price <dprice> 08/09/16 22:39:51
Modified files:
src : ChangeLog diff.c
Log message:
* diff.c (diff): Return real errors as 2 or more, like GNU diff.
(diff_filesdoneproc, diff_dirleaveproc): No longer needed.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3590&r2=1.3591
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/diff.c?cvsroot=cvs&r1=1.120&r2=1.121
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3590
retrieving revision 1.3591
diff -u -b -r1.3590 -r1.3591
--- ChangeLog 16 Sep 2008 21:52:15 -0000 1.3590
+++ ChangeLog 16 Sep 2008 22:39:50 -0000 1.3591
@@ -1,5 +1,8 @@
2008-09-16 Derek R. Price <address@hidden>
+ * diff.c (diff): Return real errors as 2 or more, like GNU diff.
+ (diff_filesdoneproc, diff_dirleaveproc): No longer needed.
+
* commit.c (commit): Handle error return from lock_tree_promotably().
* lock.c (lock_obtained, lock_wait): Move up to avoid prototypes.
(set_lock): Likewise. Accept bool in place of int. Update all callers.
Index: diff.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/diff.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -b -r1.120 -r1.121
--- diff.c 12 Sep 2007 17:27:22 -0000 1.120
+++ diff.c 16 Sep 2008 22:39:51 -0000 1.121
@@ -26,7 +26,10 @@
/* Verify interface. */
#include "diff.h"
-/* CVS headers. */
+/* GNULIB */
+#include "minmax.h"
+
+/* CVS */
#include "base.h"
#include "ignore.h"
#include "rcs.h"
@@ -50,12 +53,6 @@
static Dtype diff_dirproc (void *callerdat, const char *dir,
const char *pos_repos, const char *update_dir,
List *entries);
-static int diff_filesdoneproc (void *callerdat, int err,
- const char *repos, const char *update_dir,
- List *entries);
-static int diff_dirleaveproc (void *callerdat, const char *dir,
- int err, const char *update_dir,
- List *entries);
static int diff_fileproc (void *callerdat, struct file_info *finfo);
@@ -456,7 +453,10 @@
err = get_responses_and_close ();
free (options);
options = NULL;
- return diff_errors ? diff_errors : err;
+ if (err) return MAX (2, err); /* When diff encounters real errors it
+ * returns 2.
+ */
+ return diff_errors;
}
#endif
@@ -472,9 +472,8 @@
wrap_setup ();
/* start the recursion processor */
- err = start_recursion (diff_fileproc, diff_filesdoneproc, diff_dirproc,
- diff_dirleaveproc, NULL, argc, argv, local,
- which, 0, CVS_LOCK_READ, NULL, 1, NULL);
+ err = start_recursion (diff_fileproc, NULL, diff_dirproc, NULL, NULL, argc,
+ argv, local, which, 0, CVS_LOCK_READ, NULL, 1, NULL);
/* clean up */
free (options);
@@ -493,7 +492,10 @@
if (diff_rev2)
free (diff_rev2);
- return err;
+ if (err) return MAX (2, err); /* When diff encounters real errors it
+ * returns 2.
+ */
+ return diff_errors;
}
@@ -1037,19 +1039,18 @@
freevers_ts (&vers);
diff_mark_errors (err);
- return err;
+ return 0;
}
/*
- * Remember the exit status for each file.
+ * Remember the maximum exit status for all files.
*/
void
diff_mark_errors (int err)
{
- if (err > diff_errors)
- diff_errors = err;
+ if (err > diff_errors) diff_errors = err;
}
@@ -1077,32 +1078,6 @@
-/*
- * Concoct the proper exit status - done with files
- */
-/* ARGSUSED */
-static int
-diff_filesdoneproc (void *callerdat, int err, const char *repos,
- const char *update_dir, List *entries)
-{
- return diff_errors;
-}
-
-
-
-/*
- * Concoct the proper exit status - leaving directories
- */
-/* ARGSUSED */
-static int
-diff_dirleaveproc (void *callerdat, const char *dir, int err,
- const char *update_dir, List *entries)
-{
- return diff_errors;
-}
-
-
-
struct diff_info *
get_diff_info (void)
{
- [Cvs-cvs] ccvs/src ChangeLog diff.c,
Derek Robert Price <=