@@ -641,16 +641,6 @@ struct bufsize {
641
641
int bufsiz = 0 ;
642
642
};
643
643
644
- /* !
645
- * Option to defer spawning of the child process
646
- * till `Popen::start_process` API is called.
647
- * Default value is false.
648
- */
649
- struct defer_spawn {
650
- explicit defer_spawn (bool d): defer(d) {}
651
- bool defer = false ;
652
- };
653
-
654
644
/* !
655
645
* Option to close all file descriptors
656
646
* when the child process is spawned.
@@ -947,7 +937,6 @@ struct ArgumentDeducer
947
937
void set_option (cwd&& cwdir);
948
938
void set_option (bufsize&& bsiz);
949
939
void set_option (environment&& env);
950
- void set_option (defer_spawn&& defer);
951
940
void set_option (input&& inp);
952
941
void set_option (output&& out);
953
942
void set_option (error&& err);
@@ -1153,8 +1142,6 @@ class Streams
1153
1142
in case of redirection. See piping examples.
1154
1143
*12. error() - Get the error channel/File pointer. Usually used
1155
1144
in case of redirection.
1156
- *13. start_process() - Start the child process. Only to be used when
1157
- * `defer_spawn` option was provided in Popen constructor.
1158
1145
*/
1159
1146
class Popen
1160
1147
{
@@ -1172,7 +1159,7 @@ class Popen
1172
1159
// Setup the communication channels of the Popen class
1173
1160
stream_.setup_comm_channels ();
1174
1161
1175
- if (!defer_process_start_) execute_process ();
1162
+ execute_process ();
1176
1163
}
1177
1164
1178
1165
template <typename ... Args>
@@ -1184,7 +1171,7 @@ class Popen
1184
1171
// Setup the communication channels of the Popen class
1185
1172
stream_.setup_comm_channels ();
1186
1173
1187
- if (!defer_process_start_) execute_process ();
1174
+ execute_process ();
1188
1175
}
1189
1176
1190
1177
template <typename ... Args>
@@ -1195,7 +1182,7 @@ class Popen
1195
1182
// Setup the communication channels of the Popen class
1196
1183
stream_.setup_comm_channels ();
1197
1184
1198
- if (!defer_process_start_) execute_process ();
1185
+ execute_process ();
1199
1186
}
1200
1187
1201
1188
/*
@@ -1207,8 +1194,6 @@ class Popen
1207
1194
}
1208
1195
*/
1209
1196
1210
- void start_process () noexcept (false );
1211
-
1212
1197
int pid () const noexcept { return child_pid_; }
1213
1198
1214
1199
int retcode () const noexcept { return retcode_; }
@@ -1282,7 +1267,6 @@ class Popen
1282
1267
std::future<void > cleanup_future_;
1283
1268
#endif
1284
1269
1285
- bool defer_process_start_ = false ;
1286
1270
bool close_fds_ = false ;
1287
1271
bool session_leader_ = false ;
1288
1272
@@ -1323,20 +1307,6 @@ inline void Popen::populate_c_argv()
1323
1307
cargv_.push_back (nullptr );
1324
1308
}
1325
1309
1326
- inline void Popen::start_process () noexcept (false )
1327
- {
1328
- // The process was started/tried to be started
1329
- // in the constructor itself.
1330
- // For explicitly calling this API to start the
1331
- // process, 'defer_spawn' argument must be set to
1332
- // true in the constructor.
1333
- if (!defer_process_start_) {
1334
- assert (0 );
1335
- return ;
1336
- }
1337
- execute_process ();
1338
- }
1339
-
1340
1310
inline int Popen::wait () noexcept (false )
1341
1311
{
1342
1312
#ifdef __USING_WINDOWS__
@@ -1594,10 +1564,6 @@ namespace detail {
1594
1564
popen_->env_ = std::move (env.env_ );
1595
1565
}
1596
1566
1597
- inline void ArgumentDeducer::set_option (defer_spawn&& defer) {
1598
- popen_->defer_process_start_ = defer.defer ;
1599
- }
1600
-
1601
1567
inline void ArgumentDeducer::set_option (session_leader&& sleader) {
1602
1568
popen_->session_leader_ = sleader.leader_ ;
1603
1569
}
0 commit comments