@@ -119,9 +119,8 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
119
119
// Use process ID as a unique ID for this process at this time.
120
120
base_name.append (std::to_string (GetCurrentProcessId ()));
121
121
const std::string in_name = base_name + " \\ IN" ;
122
- LPCSTR tmp_str = in_name.c_str ();
123
122
child_std_IN_Rd = CreateNamedPipe (
124
- tmp_str ,
123
+ in_name. c_str () ,
125
124
PIPE_ACCESS_INBOUND, // Reading for us
126
125
PIPE_TYPE_BYTE | PIPE_NOWAIT, // Bytes and non-blocking
127
126
PIPE_UNLIMITED_INSTANCES, // Probably doesn't matter
@@ -135,7 +134,7 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
135
134
}
136
135
// Connect to the other side of the pipe
137
136
child_std_IN_Wr = CreateFileA (
138
- tmp_str ,
137
+ in_name. c_str () ,
139
138
GENERIC_WRITE, // Write side
140
139
FILE_SHARE_READ | FILE_SHARE_WRITE, // Shared read/write
141
140
&sec_attr, // Need this for inherit
@@ -152,9 +151,8 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
152
151
" Input pipe creation failed on SetHandleInformation" );
153
152
}
154
153
const std::string out_name = base_name + " \\ OUT" ;
155
- tmp_str = out_name.c_str ();
156
154
child_std_OUT_Rd = CreateNamedPipe (
157
- tmp_str ,
155
+ out_name. c_str () ,
158
156
PIPE_ACCESS_INBOUND, // Reading for us
159
157
PIPE_TYPE_BYTE | PIPE_NOWAIT, // Bytes and non-blocking
160
158
PIPE_UNLIMITED_INSTANCES, // Probably doesn't matter
@@ -168,7 +166,7 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
168
166
" Output pipe creation failed for child_std_OUT_Rd" );
169
167
}
170
168
child_std_OUT_Wr = CreateFileA (
171
- tmp_str ,
169
+ out_name. c_str () ,
172
170
GENERIC_WRITE, // Write side
173
171
FILE_SHARE_READ | FILE_SHARE_WRITE, // Shared read/write
174
172
&sec_attr, // Need this for inherit
0 commit comments