Re: [HACKERS] pg_regress breaks on msys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] pg_regress breaks on msys
Date: 2006-07-29 22:38:12
Message-ID: 20400.1154212692@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-07-29 23:05:13 Re: [HACKERS] putting CHECK_FOR_INTERRUPTS in
Previous Message Andrew Dunstan 2006-07-29 20:15:53 Re: [HACKERS] Possible explanation for Win32 stats regression

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-07-29 23:05:13 Re: [HACKERS] putting CHECK_FOR_INTERRUPTS in
Previous Message Andrew Dunstan 2006-07-29 20:15:53 Re: [HACKERS] Possible explanation for Win32 stats regression