Index: trunk/psLib/test/sys/tst_psTrace.c
===================================================================
--- trunk/psLib/test/sys/tst_psTrace.c	(revision 4547)
+++ trunk/psLib/test/sys/tst_psTrace.c	(revision 4944)
@@ -8,4 +8,6 @@
 #include "pslib_strict.h"
 #include "psTest.h"
+#include <fcntl.h>
+#include <unistd.h>
 
 
@@ -49,5 +51,6 @@
     psS32 lev = 0;
 
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
 
     for (i=0;i<10;i++) {
@@ -96,5 +99,6 @@
 static psS32 testTrace01(void)
 {
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
     (void)psTraceSetLevel(".A.B.C.D.E", 5);
 
@@ -111,5 +115,6 @@
 {
     psTraceReset();
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
     psTraceSetLevel(".A.B", 2);
     psTraceSetLevel(".A.B.C.D.E", 5);
@@ -142,5 +147,6 @@
     psS32 lev = 0;
 
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
 
     for (i=0;i<10;i++) {
@@ -183,16 +189,21 @@
 {
     FILE *fp;
+    int FD;
     psS32 nb = 0;
-
-    fp = fopen("tst_psTrace02_OUT", "w");
+    FD = creat("tst_psTrace02_OUT", 0666);
+    //    printf("\nFD = %d\n", FD);
+    //    fp = fopen("tst_psTrace02_OUT", "w");
+    fp = fdopen(FD, "w");
     for (nb = 0 ; nb<4;nb++) {
         if (nb == 0)
-            psTraceSetDestination(stdout);
+            //            psTraceSetDestination(stdout);
+            psTraceSetDestination(1);
         if (nb == 1)
-            psTraceSetDestination(stderr);
+            //            psTraceSetDestination(stderr);
+            psTraceSetDestination(2);
         if (nb == 2)
-            psTraceSetDestination(NULL);
+            psTraceSetDestination(-1); //NULL
         if (nb == 3)
-            psTraceSetDestination(fp);
+            psTraceSetDestination(FD);
 
         (void)psTraceSetLevel(".", 4);
@@ -221,4 +232,5 @@
 
     fclose(fp);
+    close(FD);
 
     return(0);
@@ -227,5 +239,6 @@
 static psS32 testTrace05(void)
 {
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
 
     (void)psTraceSetLevel(".", 9);
@@ -277,5 +290,6 @@
 static psS32 testTrace06(void)
 {
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
 
     (void)psTraceSetLevel(".", 9);
