Thread: thread safety testing fix

thread safety testing fix

From
Andreas Pflug
Date:
When checking for thread safety with src/tools/thread/thread_test.c, the
mktemp function wants an argument that contains 6 X, while the current
version only supplies 5 X which will fail on my SuSE 8.1.

Patch attached.


Regards,
Andreas
Index: thread_test.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/tools/thread/thread_test.c,v
retrieving revision 1.29
diff -u -r1.29 thread_test.c
--- thread_test.c    27 Apr 2004 19:51:12 -0000    1.29
+++ thread_test.c    28 May 2004 11:39:00 -0000
@@ -64,8 +64,8 @@
 void        func_call_1(void);
 void        func_call_2(void);

-#define        TEMP_FILENAME_1    "/tmp/thread_test.1.XXXXX"
-#define        TEMP_FILENAME_2    "/tmp/thread_test.2.XXXXX"
+#define        TEMP_FILENAME_1    "/tmp/thread_test.1.XXXXXX"
+#define        TEMP_FILENAME_2    "/tmp/thread_test.2.XXXXXX"

 char       *temp_filename_1;
 char       *temp_filename_2;

Re: thread safety testing fix

From
Tom Lane
Date:
Andreas Pflug <pgadmin@pse-consulting.de> writes:
> When checking for thread safety with src/tools/thread/thread_test.c, the
> mktemp function wants an argument that contains 6 X, while the current
> version only supplies 5 X which will fail on my SuSE 8.1.
> Patch attached.

Isn't this going to break platforms that only want 5 X's ?

            regards, tom lane

Re: thread safety testing fix

From
Bruce Momjian
Date:
Thanks.  Fixed.

---------------------------------------------------------------------------

Andreas Pflug wrote:
> When checking for thread safety with src/tools/thread/thread_test.c, the
> mktemp function wants an argument that contains 6 X, while the current
> version only supplies 5 X which will fail on my SuSE 8.1.
>
> Patch attached.
>
>
> Regards,
> Andreas

> Index: thread_test.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/tools/thread/thread_test.c,v
> retrieving revision 1.29
> diff -u -r1.29 thread_test.c
> --- thread_test.c    27 Apr 2004 19:51:12 -0000    1.29
> +++ thread_test.c    28 May 2004 11:39:00 -0000
> @@ -64,8 +64,8 @@
>  void        func_call_1(void);
>  void        func_call_2(void);
>
> -#define        TEMP_FILENAME_1    "/tmp/thread_test.1.XXXXX"
> -#define        TEMP_FILENAME_2    "/tmp/thread_test.2.XXXXX"
> +#define        TEMP_FILENAME_1    "/tmp/thread_test.1.XXXXXX"
> +#define        TEMP_FILENAME_2    "/tmp/thread_test.2.XXXXXX"
>
>  char       *temp_filename_1;
>  char       *temp_filename_2;

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: thread safety testing fix

From
Andreas Pflug
Date:
Tom Lane wrote:

>Andreas Pflug <pgadmin@pse-consulting.de> writes:
>
>
>>When checking for thread safety with src/tools/thread/thread_test.c, the
>>mktemp function wants an argument that contains 6 X, while the current
>>version only supplies 5 X which will fail on my SuSE 8.1.
>>Patch attached.
>>
>>
>
>Isn't this going to break platforms that only want 5 X's ?
>

Probably not., any additional X will just be ignored.
AFAICS all platforms want at least 6 X anyway.

Regards,
Andreas


Re: thread safety testing fix

From
Bruce Momjian
Date:
Tom Lane wrote:
> Andreas Pflug <pgadmin@pse-consulting.de> writes:
> > When checking for thread safety with src/tools/thread/thread_test.c, the
> > mktemp function wants an argument that contains 6 X, while the current
> > version only supplies 5 X which will fail on my SuSE 8.1.
> > Patch attached.
>
> Isn't this going to break platforms that only want 5 X's ?

My BSD/OS doesn't specify a specific number of X's, but it does use an
example with six, so six should be fine.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073