| 141 | } |
| 142 | |
| 143 | void SubProcess::SetChannelAction(Channel chan, ChannelAction action) { |
| 144 | mutex_lock procLock(proc_mu_); |
| 145 | mutex_lock dataLock(data_mu_); |
| 146 | if (running_) { |
| 147 | LOG(FATAL) << "SetChannelAction called after the process was started."; |
| 148 | } else if (!chan_valid(chan)) { |
| 149 | LOG(FATAL) << "SetChannelAction called with invalid channel: " << chan; |
| 150 | } else if ((action != ACTION_CLOSE) && (action != ACTION_PIPE) && |
| 151 | (action != ACTION_DUPPARENT)) { |
| 152 | LOG(FATAL) << "SetChannelAction called with invalid action: " << action; |
| 153 | } else { |
| 154 | action_[chan] = action; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | bool SubProcess::Start() { |
| 159 | mutex_lock procLock(proc_mu_); |
no outgoing calls