delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/28/08:32:30

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_HK_NAME_DR,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
Subject: Re: rcsdiff in RCS version 5.7 seems broken
References: <AANLkTin45Ooda9SczFBc6CB56IFd112Rpdel5uLaBO4O AT mail DOT gmail DOT com>
From: "Dr. Volker Zell" <dr DOT volker DOT zell AT oracle DOT com>
Date: Fri, 28 May 2010 14:31:31 +0200
In-Reply-To: <AANLkTin45Ooda9SczFBc6CB56IFd112Rpdel5uLaBO4O@mail.gmail.com> (R. DeFuria's message of "Thu, 27 May 2010 13:02:31 -0400")
Message-ID: <7zsk5c9pi4.fsf@vzell-de.de.oracle.com>
User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (cygwin32)
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

>>>>> R DeFuria writes:

    > Hello,
    > Yesterday, I (re)ran v 2.697 of Cygwin's setup.exe to update anything
    > that was out of date.

    > Among other things, it updated RCS.

    > Now, the rcsdiff command no longer works on my box:
    >      Dell Precision WorkStation 390 running Windows Vista Business
    > (x64) Service Pack 2

    > Here are the symptoms:
    >      $ rcsdiff test.txt
    >      ===================================================================
    >      RCS file: RCS/test.txt,v
    >      retrieving revision 1.1
    >      co: not found
    >      rcsdiff: RCS/test.txt,v: co failed

    >      $ echo $?
    >      2
    > *** n.b., ALL OTHER RCS COMMANDS WORK -- ci, co, rcsdiff, rlog, ...

I can confirm this, but do not understand whats going on.  By the way,
when you do rcsdiff and co is in the same directory as the source file
it workks.

I created a debugging version and the difference between successfull and
unsuccessfull runs are, that wstatus=512 when it fails and wstatus=0 otherwise
in the line

  if (waitpid(pid, &wstatus, 0) < 0)

in the following code:  

#if has_fork
	pid_t pid;
	if (!(pid = vfork())) {
		char const *notfound;
		if (infd != -1  &&  infd != STDIN_FILENO  &&  (
#		    ifdef F_DUPFD
			(VOID close(STDIN_FILENO),
			fcntl(infd, F_DUPFD, STDIN_FILENO) != STDIN_FILENO)
#		    else
			dup2(infd, STDIN_FILENO) != STDIN_FILENO
#		    endif
		)) {
		    /* Avoid perror since it may misuse buffers.  */
		    write_stderr(args[1]);
		    write_stderr(": I/O redirection failed\n");
		    _exit(EXIT_TROUBLE);
		}

		if (outname)
		    if (fdreopen(
			STDOUT_FILENO, outname,
			O_CREAT | O_TRUNC | O_WRONLY | OPEN_O_BINARY
		    ) < 0) {
			/* Avoid perror since it may misuse buffers.  */
			write_stderr(args[1]);
			write_stderr(": ");
			write_stderr(outname);
			write_stderr(": cannot create\n");
			_exit(EXIT_TROUBLE);
		    }
		VOID exec_RCS(args[1], (char**)(args + 1));
		notfound = args[1];
#		ifdef RCS_SHELL
		    if (errno == ENOEXEC) {
			args[0] = notfound = RCS_SHELL;
			VOID execv(args[0], (char**)args);
		    }
#		endif

		/* Avoid perror since it may misuse buffers.  */
		write_stderr(notfound);
		write_stderr(": not found\n");
		_exit(EXIT_TROUBLE);
	}
	if (pid < 0)
		efaterror("fork");
#	if has_waitpid
		if (waitpid(pid, &wstatus, 0) < 0)
			efaterror("waitpid");
#	else
		{
			pid_t w;
			do {
				if ((w = wait(&wstatus)) < 0)
					efaterror("wait");
			} while (w != pid);
		}
#	endif
#else
	static struct buf b;
	char const *p;

	/* Use system().  On many hosts system() discards signals.  Yuck!  */
	p = args + 1;
	bufscpy(&b, *p);
	while (*++p)
		bufargcat(&b, ' ', *p);
	if (infd != -1  &&  infd != STDIN_FILENO) {
		char redirection[32];
		VOID sprintf(redirection, "<&%d", infd);
		bufscat(&b, redirection);
	}
	if (outname)
		bufargcat(&b, '>', outname);
	wstatus = system(b.string);
#endif
#endif
    }
	if (!WIFEXITED(wstatus)) {
		if (WIFSIGNALED(wstatus)) {
			psignal(WTERMSIG(wstatus), args[1]);
			fatcleanup(1);
		}
		faterror("%s failed for unknown reason", args[1]);
	}
	return WEXITSTATUS(wstatus);

    
Ciao
  Volker
  

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019