Ignore:
Timestamp:
Jan 12, 2014, 2:48:38 PM (11 years ago)
Author:
ldelgass
Message:

Revert some changes from r4108: nanovis and vtkvis redirect stdout/stderr to
the trace log. Default to using stdin/stdout in nanovis/vtkvis when no command
line option is given. Add command line options to nanoscale config file to
set socket descriptor for nanovis/vtkvis/geovis.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/RenderServer.cpp

    r4108 r4111  
    4343
    4444int VtkVis::g_statsFile = -1; ///< Stats output file descriptor.
    45 #define CLIENT_READ     (3)
    46 #define CLIENT_WRITE    (4)
    47 int VtkVis::g_fdIn = CLIENT_READ; ///< Input file descriptor
    48 int VtkVis::g_fdOut = CLIENT_WRITE; ///< Output file descriptor
     45int VtkVis::g_fdIn = STDIN_FILENO; ///< Input file descriptor
     46int VtkVis::g_fdOut = STDOUT_FILENO; ///< Output file descriptor
    4947FILE *VtkVis::g_fOut = NULL; ///< Output file handle
    5048FILE *VtkVis::g_fLog = NULL; ///< Trace logging file handle
     
    409407initService()
    410408{
    411     // Create a stream associated with the client read file descriptor.  If
    412     // we're not using a socket (fdopen of descriptor 4 will return NULL),
    413     // then use descriptor 1 and stdout respectively.
     409    // Create a stream associated with the output file descriptor
    414410    g_fOut = fdopen(g_fdOut, "w");
    415     // If running without socket, use stdout for debugging
     411    // If running without a socket, use stdout for debugging
    416412    if (g_fOut == NULL && g_fdOut != STDOUT_FILENO) {
    417413        g_fdOut = STDOUT_FILENO;
     
    436432    }
    437433
    438     // Nanoscale automatically redirects stdout and stderr to log files.
    439434    // open log and map stderr to log file
    440435    g_fLog = fopen(logName, "w");
    441436    dup2(fileno(g_fLog), STDERR_FILENO);
     437    // If we are writing to socket, map stdout to log
     438    if (g_fdOut != STDOUT_FILENO) {
     439        dup2(fileno(g_fLog), STDOUT_FILENO);
     440    }
     441
     442    fflush(stdout);
    442443
    443444    // clean up malloc'd memory
Note: See TracChangeset for help on using the changeset viewer.