This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rcsdiff in RCS version 5.7 seems broken


>>>>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]