Index: trunk/psLib/src/sys/psTrace.c
===================================================================
--- trunk/psLib/src/sys/psTrace.c	(revision 4578)
+++ trunk/psLib/src/sys/psTrace.c	(revision 4944)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-18 20:54:22 $
+ *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:06 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -55,4 +55,5 @@
 static p_psComponent* cRoot = NULL; // The root of the trace component
 static FILE *traceFP = NULL;        // File destination for messages.
+//static int traceFD = 0;
 
 static void componentFree(p_psComponent* comp);
@@ -525,32 +526,46 @@
 
 // XXX EAM : I've added code to close the old traceFP (safely)
-void psTraceSetDestination(FILE * fp)
-{
-
-    bool special;
-
-    // XXX EAM perhaps return an error?
-    if (fp == NULL) {
+void psTraceSetDestination(int fd)
+{
+
+
+    /*
+        bool special;
+     
+        // XXX EAM perhaps return an error?
+        if (fp == NULL) {
+            return;
+        }
+     
+        // cannot close traceFP if one of the special FILE ptrs
+        special  = (traceFP == NULL);
+        special |= (traceFP == stdin);
+        special |= (traceFP == stdout);
+        special |= (traceFP == stderr);
+     
+        if (!special) {
+            fclose (traceFP);
+        }
+        traceFP = fp;
+    */
+    if (fd == -1) {
         return;
     }
-
-    // cannot close traceFP if one of the special FILE ptrs
-    special  = (traceFP == NULL);
-    special |= (traceFP == stdin);
-    special |= (traceFP == stdout);
-    special |= (traceFP == stderr);
-
-    if (!special) {
-        fclose (traceFP);
-    }
-    traceFP = fp;
-}
-
-FILE *psTraceGetDestination()
-{
-    if (traceFP == NULL) {
+    if (fd == 1) {
         traceFP = stdout;
-    }
-    return traceFP;
+    } else if (fd == 2) {
+        traceFP = stderr;
+    } else if (fd == 0) {
+        traceFP = stdin;
+    } else if (fd > 2) {
+        traceFP = fdopen(fd, "w");
+    }
+}
+
+int psTraceGetDestination()
+{
+    int fd;
+    fd = fileno(traceFP);
+    return fd;
 }
 
