[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug] sdiff-2.8.1: wrong subsidiary program check
From: |
Takashi Matsuda |
Subject: |
Re: [Bug] sdiff-2.8.1: wrong subsidiary program check |
Date: |
Thu, 5 Sep 2002 17:24:03 +0900 |
In my environment, config.h says:
#define HAVE_WORKING_FORK 1
#define HAVE_WORKING_VFORK 1
I tried to merge two files:
% cat src1.txt
a
% cat src2.txt
b
% sdiff src1.txt src2.txt -o dst.txt
a | b
%l
sdiff: subsidiary program `vim' failed
In this case, waitpid() stored 256 into wstatus.
When I did following, sdiff works correctly.
% sdiff src1.txt src1.txt -o dst.txt
On Thu, 5 Sep 2002 00:28:16 -0700 (PDT)
Paul Eggert <address@hidden> wrote:
> > From: Takashi Matsuda <address@hidden>
> > Date: Thu, 5 Sep 2002 11:19:10 +0900
> >
> > In my environment (cygwin 1.3.12), sdiff aborts execution finally,
> > saying "subsidiary program `...' failed", even if it seems run
> > normally.
> >
> > I read the source of sdiff 2.8.1 and found one problem.
> > In the function "sdiff.c:1220:ck_editor_status()", it check the
> > error situation by the code "if (errno | status)".
> > IMHO, "status == 0" does not meen the normal situation in all
> > environment, at least cygwin.
>
> Can you please explain the situations in Cygwin where status != 0
> but the program ran normally?
>
> What are the values in config.h for HAVE_WORKING_FORK and
> HAVE_WORKING_VFORK?
>
> I am thinking of changing ck_editor_status to be the following; would
> this fix things for you?
>
> static void
> ck_editor_status (int errnum, int status)
> {
> if (errnum | status)
> {
> error (0, errnum,
> _((errnum || ! WIFEXITED (status)
> || WEXITSTATUS (status) < 126 || 127 < WEXITSTATUS (status))
> ? "subsidiary program `%s' failed"
> : WEXITSTATUS (status) == 126
> ? "subsidiary program `%s' could not be invoked"
> : "subsidiary program `%s' not found"),
> editor_program);
> exiterr ();
> }
> }
>