From 7ce74ce206065c3af0035583330b3c773086f21c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 3 Nov 2016 00:44:53 +0300 Subject: Invent auto_fd, make use of it in fdstreams and process --- butl/process | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'butl/process') diff --git a/butl/process b/butl/process index c69c306..e98e367 100644 --- a/butl/process +++ b/butl/process @@ -17,6 +17,7 @@ #include #include #include +#include // auto_fd namespace butl { @@ -134,7 +135,7 @@ namespace butl // the child process. When reading in the text mode the sequence of 0xD, // 0xA characters is translated into the single OxA character and 0x1A is // interpreted as EOF. When writing in the text mode the OxA character is - // translated into the 0xD, 0xA sequence. Use the _setmode() function to + // translated into the 0xD, 0xA sequence. Use the fdmode() function to // change the mode, if required. // // Instead of passing -1, -2 or the default value, you can also pass your @@ -216,8 +217,6 @@ namespace butl // Create an empty or "already terminated" process. By default the // termination status is abnormal but you can change that. // - // @@ Need to audit all calls (__attribute__((deprecated))). - // explicit process (optional status = nullopt); @@ -295,9 +294,12 @@ namespace butl handle_type handle; optional status; // Absence means terminated abnormally. - int out_fd; // Write to this fd to send to the new process' stdin. - int in_ofd; // Read from this fd to receive from the new process' stdout. - int in_efd; // Read from this fd to receive from the new process' stderr. + // Use the following file descriptors to communicate with the new process's + // standard streams. + // + auto_fd out_fd; // Write to it to send to stdin. + auto_fd in_ofd; // Read from it to receive from stdout. + auto_fd in_efd; // Read from it to receive from stderr. }; } -- cgit v1.1