Skip to content

Commit 02bba8a

Browse files
committed
Minor fix
1 parent 657df3b commit 02bba8a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/util/piped_process.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
119119
// Use process ID as a unique ID for this process at this time.
120120
base_name.append(std::to_string(GetCurrentProcessId()));
121121
const std::string in_name = base_name + "\\IN";
122-
LPCSTR tmp_str = in_name.c_str();
123122
child_std_IN_Rd = CreateNamedPipe(
124-
tmp_str,
123+
in_name.c_str(),
125124
PIPE_ACCESS_INBOUND, // Reading for us
126125
PIPE_TYPE_BYTE | PIPE_NOWAIT, // Bytes and non-blocking
127126
PIPE_UNLIMITED_INSTANCES, // Probably doesn't matter
@@ -135,7 +134,7 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
135134
}
136135
// Connect to the other side of the pipe
137136
child_std_IN_Wr = CreateFileA(
138-
tmp_str,
137+
in_name.c_str(),
139138
GENERIC_WRITE, // Write side
140139
FILE_SHARE_READ | FILE_SHARE_WRITE, // Shared read/write
141140
&sec_attr, // Need this for inherit
@@ -152,9 +151,8 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
152151
"Input pipe creation failed on SetHandleInformation");
153152
}
154153
const std::string out_name = base_name + "\\OUT";
155-
tmp_str = out_name.c_str();
156154
child_std_OUT_Rd = CreateNamedPipe(
157-
tmp_str,
155+
out_name.c_str(),
158156
PIPE_ACCESS_INBOUND, // Reading for us
159157
PIPE_TYPE_BYTE | PIPE_NOWAIT, // Bytes and non-blocking
160158
PIPE_UNLIMITED_INSTANCES, // Probably doesn't matter
@@ -168,7 +166,7 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
168166
"Output pipe creation failed for child_std_OUT_Rd");
169167
}
170168
child_std_OUT_Wr = CreateFileA(
171-
tmp_str,
169+
out_name.c_str(),
172170
GENERIC_WRITE, // Write side
173171
FILE_SHARE_READ | FILE_SHARE_WRITE, // Shared read/write
174172
&sec_attr, // Need this for inherit

0 commit comments

Comments
 (0)