Ignore:
Timestamp:
2010-05-27T11:32:46+12:00 (14 years ago)
Author:
davidb
Message:

Further expansion of functionality (and testing) or os_process classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/recpt/os_process_unix.cpp

    r22178 r22183  
    3838
    3939#include <unistd.h>
     40#include <sys/wait.h>
    4041
    4142#include "os_process_unix.h"
    4243
    43 osprocessunix::osprocessunix(char* cmdline, OSProcessPipeMode mode)
     44osprocessunix::osprocessunix(OSProcessPipeMode mode,
     45                 char* prog_name, char* argv[], char* envp[])
    4446  : child_stdout_read_(-1), child_stdin_write_(-1),
    45     osprocess(cmdline,mode)
     47    osprocess(mode,prog_name,argv,envp)
    4648{
    4749 
     
    112114
    113115   
    114     // execvp?
    115     execve(cmdline, NULL, NULL);
    116 
     116    // Used to be execve(), but this would appear not to search path for
     117    // 'prog_name'. The alternative execvp() does search PATH and so is
     118    // more compatible with how CreateProcess works for Windows
     119
     120    // Need to connect envp with externally defined '**environ' ??
     121
     122    execvp(prog_name,argv);
    117123   
    118124  }
     
    178184
    179185
    180  
     186void osprocessunix::wait()
     187{
     188  int child_status;
     189  //cerr << "**** waiting ..." << endl;
     190  ::waitpid(pid_,&child_status,0);
     191
     192  //cerr << "*** exit status = " << WEXITSTATUS(child_status) << endl;
     193
     194  //cerr << "**** done" << endl;
     195}
     196
     197
    181198bool osprocessunix::close_write_pipe(OSProcessWarnStatus warn_status)
    182199{
Note: See TracChangeset for help on using the changeset viewer.