Re: [PATCHES] pg_regress breaks on msys - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] pg_regress breaks on msys
Date
Msg-id 20400.1154212692@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> I modified pg_regress.c to use just the return code to determine if the
> diff worked, but I added in a WIN32-specific test for the file size.  I
> think that is the cleanest solution.  Attached.

It really needs a comment, along the lines of

    /*
     * On Windows we'll get exit status 1 if the diff invocation
     * failed; so we need a way to distinguish failure from "files
     * are different".  Check to make sure that a diff file was
     * created and is nonempty.
     */

Also the test ought to account for file_size returning -1 if file's
not there, so

+ #ifdef WIN32
+     if (WEXITSTATUS(r) == 1 && file_size(filename) <= 0)
...

            regards, tom lane

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [PATCHES] Possible explanation for Win32 stats regression
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] putting CHECK_FOR_INTERRUPTS in