Source-Changes-HG archive

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

[src/netbsd-3]: src/gnu/dist/diffutils/src Pull up following revision(s) (req...



details:   https://anonhg.NetBSD.org/src/rev/a99426d07c69
branches:  netbsd-3
changeset: 577857:a99426d07c69
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Mar 01 03:49:25 2006 +0000

description:
Pull up following revision(s) (requested by apb in ticket #1183):
        gnu/dist/diffutils/src/sdiff.c: revision 1.2
Merge the check_child_status function from diffutils-2.8.7.
The rest of the gnu/dist/diffutils tree remains at version 2.8.1.
Fixes PR 23162 from George Michaelson (etcupdate/sdiff report
error on applying merge edits)
Approved by wiz, christos

diffstat:

 gnu/dist/diffutils/src/sdiff.c |  37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diffs (67 lines):

diff -r d57270adfdb3 -r a99426d07c69 gnu/dist/diffutils/src/sdiff.c
--- a/gnu/dist/diffutils/src/sdiff.c    Sun Feb 26 21:58:25 2006 +0000
+++ b/gnu/dist/diffutils/src/sdiff.c    Wed Mar 01 03:49:25 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdiff.c,v 1.1.1.1 2003/01/26 00:43:17 wiz Exp $        */
+/*     $NetBSD: sdiff.c,v 1.1.1.1.6.1 2006/03/01 03:49:25 riz Exp $    */
 
 /* sdiff - side-by-side merge of file differences
 
@@ -263,22 +263,24 @@
 }
 
 static void
-ck_editor_status (int errnum, int status)
+check_child_status (int werrno, int wstatus, int max_ok_status,
+                   char const *subsidiary_program)
 {
-  if (errnum | status)
+  int status = (! werrno && WIFEXITED (wstatus)
+               ? WEXITSTATUS (wstatus)
+               : INT_MAX);
+
+  if (max_ok_status < status)
     {
-      char const *failure_msgid = N_("subsidiary program `%s' failed");
-      if (! errnum && WIFEXITED (status))
-       switch (WEXITSTATUS (status))
-         {
-         case 126:
-           failure_msgid = N_("subsidiary program `%s' not executable");
-           break;
-         case 127:
-           failure_msgid = N_("subsidiary program `%s' not found");
-           break;
-         }
-      error (0, errnum, _(failure_msgid), editor_program);
+      error (0, werrno,
+            _(status == 126
+              ? "subsidiary program `%s' could not be invoked"
+              : status == 127
+              ? "subsidiary program `%s' not found"
+              : status == INT_MAX
+              ? "subsidiary program `%s' failed"
+              : "subsidiary program `%s' failed (exit status %d)"),
+            subsidiary_program, status);
       exiterr ();
     }
 }
@@ -726,7 +728,7 @@
        if (! interact_ok)
          exiterr ();
 
-       ck_editor_status (werrno, wstatus);
+       check_child_status (werrno, wstatus, EXIT_FAILURE, diffargv[0]);
        untrapsig (0);
        checksigs ();
        exit (WEXITSTATUS (wstatus));
@@ -1089,7 +1091,8 @@
              }
 
              ignore_SIGINT = 0;
-             ck_editor_status (werrno, wstatus);
+             check_child_status (werrno, wstatus, EXIT_SUCCESS,
+                                 editor_program);
            }
 
            {



Home | Main Index | Thread Index | Old Index