~zorba-coders/zorba/bug-1027142-process-leak

« back to all changes in this revision

Viewing changes to src/com/zorba-xquery/www/modules/process.xq.src/process.cpp

  • Committer: mbrantner
  • Date: 2011-08-15 21:40:39 UTC
  • Revision ID: svn-v4:8046edc3-af21-0410-8661-ec7318497eea:modules/process/trunk:11687
Tags: zorba-2.0.2
fix the build of the process module on Mac and Windows

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#   endif
34
34
#else
35
35
#  include <unistd.h>
36
 
#  include <wait.h>
 
36
#  ifdef __APPLE__
 
37
#    include <sys/wait.h>
 
38
#  else
 
39
#    include <wait.h>
 
40
#  endif
37
41
#endif
38
42
 
39
43
#include <zorba/item_factory.h>
412
416
 
413
417
#ifdef WIN32
414
418
  std::string lCommandLineString=lTmp.str();
415
 
  int status = run_process(lCommandLineString,lStdout,lStderr);
 
419
  int code = run_process(lCommandLineString,lStdout,lStderr);
416
420
  
417
 
  if (status != 0)
 
421
  if (code != 0)
418
422
  {
419
423
    std::stringstream lErrorMsg;
420
 
    lErrorMsg << "Failed to execute the command (" << status << ")";
 
424
    lErrorMsg << "Failed to execute the command (" << code << ")";
421
425
    Item lQName = ProcessModule::getItemFactory()->createQName(
422
426
      "http://www.zorba-xquery.com/modules/process", "PROC01");
423
427
    throw USER_EXCEPTION(lQName, lErrorMsg.str().c_str());