Changeset 2659


Ignore:
Timestamp:
08/03/2010 21:30:42 (2 years ago)
Author:
chris
Message:

Merge remained of [2597] from trunk into 0.11rc7. Make
LocalProcessStream?? constructor take a std::string& for C++ style.

Location:
box/RELEASE/0.11rc7/lib/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • box/RELEASE/0.11rc7/lib/server/LocalProcessStream.cpp

    r1822 r2659  
    4444// 
    4545// -------------------------------------------------------------------------- 
    46 std::auto_ptr<IOStream> LocalProcessStream(const char *CommandLine, pid_t &rPidOut) 
     46std::auto_ptr<IOStream> LocalProcessStream(const std::string& rCommandLine, 
     47        pid_t &rPidOut) 
    4748{ 
    4849#ifndef WIN32 
     
    5051        // Split up command 
    5152        std::vector<std::string> command; 
    52         SplitString(std::string(CommandLine), ' ', command); 
     53        SplitString(rCommandLine, ' ', command); 
    5354 
    5455        // Build arguments 
     
    138139        startupInfo.dwFlags   |= STARTF_USESTDHANDLES; 
    139140 
    140         CHAR* commandLineCopy = (CHAR*)malloc(strlen(CommandLine) + 1); 
    141         strcpy(commandLineCopy, CommandLine); 
     141        CHAR* commandLineCopy = (CHAR*)malloc(rCommandLine.size() + 1); 
     142        strcpy(commandLineCopy, rCommandLine.c_str()); 
    142143 
    143144        BOOL result = CreateProcess(NULL,  
     
    156157        if(!result) 
    157158        { 
    158                 BOX_ERROR("Failed to CreateProcess: '" << CommandLine << 
     159                BOX_ERROR("Failed to CreateProcess: '" << rCommandLine << 
    159160                        "': " << GetErrorMessage(GetLastError())); 
    160161                CloseHandle(writeInChild); 
  • box/RELEASE/0.11rc7/lib/server/LocalProcessStream.h

    r217 r2659  
    1414#include "IOStream.h" 
    1515 
    16 std::auto_ptr<IOStream> LocalProcessStream(const char *CommandLine, pid_t &rPidOut); 
     16std::auto_ptr<IOStream> LocalProcessStream(const std::string& rCommandLine, 
     17        pid_t &rPidOut); 
    1718 
    1819#endif // LOCALPROCESSSTREAM__H 
Note: See TracChangeset for help on using the changeset viewer.