Skip to content

Commit 58adb54

Browse files
committed
Fix the anonsocket fd name
1 parent 91f0ddb commit 58adb54

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/shims/unix/unnamed_socket.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ impl AnonSocket {
7575

7676
impl FileDescription for AnonSocket {
7777
fn name(&self) -> &'static str {
78-
// TODO: fix the name here later
79-
"socketpair"
78+
match self.fd_type {
79+
AnonSocketType::Socketpair => "socketpair",
80+
AnonSocketType::PipeRead | AnonSocketType::PipeWrite => "pipe",
81+
}
8082
}
8183

8284
fn close<'tcx>(
@@ -154,7 +156,7 @@ impl FileDescription for AnonSocket {
154156
ecx: &mut MiriInterpCx<'tcx>,
155157
) -> InterpResult<'tcx, Scalar> {
156158
// FIXME: File access mode and file creation flags should be ignored.
157-
// TODO: support flag unset
159+
// TODO: support flag unset
158160
if flag == ecx.eval_libc_i32("O_NONBLOCK") {
159161
self.is_nonblock.set(true);
160162
} else {

0 commit comments

Comments
 (0)