Tom Lane wrote:
> Alex Soto <apsoto(at)gmail(dot)com> writes:
> > Here's the section in the config.log in case it makes a difference
> > configure:28808: ./conftest
> > Could not create file in /tmp or
> > Could not generate failure for create file in /tmp **
> > exiting
> > configure:28812: $? = 1
> > configure: program exited with status 1
> [ greps... ] Oh, that error is coming from src/test/thread/thread_test.c.
> I wonder why we have that trying to write to /tmp at all, when all the
> other transient junk generated by configure is in the current directory.
> Bruce, do you have a good reason for doing it that way?
I have modified the code to use the current directory instead of /tmp.
I also cleaned up the #if defines and added some C comments.
> (The error message seems to be suffering from a bad case of copy-and-
> paste-itis, too.)
Actually, it is accurate. The code is:
h1 = CreateFile(TEMP_FILENAME_1, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, 0, NULL);
h2 = CreateFile(TEMP_FILENAME_1, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL);
if (h1 == INVALID_HANDLE_VALUE || GetLastError() != ERROR_FILE_EXISTS)
if (open(TEMP_FILENAME_1, O_RDWR | O_CREAT, 0600) < 0 ||
open(TEMP_FILENAME_1, O_RDWR | O_CREAT | O_EXCL, 0600) >= 0)
fprintf(stderr, "Could not create file in current directory or\n");
fprintf(stderr, "could not generate failure for create file in current directory **\nexiting\n");
This code generates an errno == EEXIST in one thread, while another
thread generates errno == ENOENT, and this is how we test for errno
being thread-safe. If you have a cleaner way to do this, please let me
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
+ It's impossible for everything to be true. +
In response to
pgsql-bugs by date
|Next:||From: Tom Lane||Date: 2011-08-21 05:08:59|
|Subject: Re: BUG #6166: configure from source fails with 'This platform is not thread-safe.' but was actually /tmp perms |
|Previous:||From: Alejandro Sánchez||Date: 2011-08-20 17:16:59|
|Subject: Re: BUG #6120: Problem running post-install step in Mac OS X Lion