Changeset 1416:fd9a674d0bab


Ignore:
Timestamp:
11/21/09 09:56:19 (2 years ago)
Author:
niam
Branch:
default
Message:

pc::execution::process: more precise detection of state of the process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/src/pcExecutionProcess.cc

    r1415 r1416  
    216216    } 
    217217 
    218     return true; 
     218    int status; 
     219 
     220    res = waitpid(handle->pid, &status, WNOHANG); 
     221 
     222    if (res == 0) { 
     223        return true; 
     224    } else if (res == handle->pid) { 
     225        if (WIFEXITED(status)) 
     226            handle->status = WEXITSTATUS(status); 
     227 
     228        handle->executed = false; 
     229        handle->joined = true; 
     230 
     231        return false; 
     232    } 
     233 
     234    throw exception::basic(exception::MODULE_PCEXECUTIONPROCESS, PROCESSEX_ISRUNNING, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
    219235} 
    220236 
Note: See TracChangeset for help on using the changeset viewer.