Skip to content

Commit 1c64f29

Browse files
committed
Add comment for the flag diff check
1 parent 12040aa commit 1c64f29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/shims/fs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
107107
if let Some(FileHandle { flag: old_flag, .. }) =
108108
this.machine.file_handler.handles.get_mut(&fd)
109109
{
110+
// Check that the only difference between the old flag and the current flag is
111+
// exactly the `FD_CLOEXEC` value.
110112
if flag ^ *old_flag == fd_cloexec {
111113
*old_flag = flag;
112114
} else {

0 commit comments

Comments
 (0)