@@ -576,13 +576,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
576
576
577
577
let communicate = this. machine . communicate ( ) ;
578
578
579
- let Some ( mut file_descriptor ) = this. machine . fds . get_mut ( fd) else {
579
+ let Some ( mut file_description ) = this. machine . fds . get_mut ( fd) else {
580
580
return Ok ( Scalar :: from_i64 ( this. fd_not_found ( ) ?) ) ;
581
581
} ;
582
- let result = file_descriptor
582
+ let result = file_description
583
583
. seek ( communicate, seek_from) ?
584
584
. map ( |offset| i64:: try_from ( offset) . unwrap ( ) ) ;
585
- drop ( file_descriptor ) ;
585
+ drop ( file_description ) ;
586
586
587
587
let result = this. try_unwrap_io_result ( result) ?;
588
588
Ok ( Scalar :: from_i64 ( result) )
@@ -1269,30 +1269,30 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1269
1269
return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
1270
1270
}
1271
1271
1272
- let Some ( file_descriptor ) = this. machine . fds . get ( fd) else {
1272
+ let Some ( file_description ) = this. machine . fds . get ( fd) else {
1273
1273
return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
1274
1274
} ;
1275
1275
1276
1276
// FIXME: Support ftruncate64 for all FDs
1277
1277
let FileHandle { file, writable } =
1278
- file_descriptor . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1278
+ file_description . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1279
1279
err_unsup_format ! ( "`ftruncate64` is only supported on file-backed file descriptors" )
1280
1280
} ) ?;
1281
1281
1282
1282
if * writable {
1283
1283
if let Ok ( length) = length. try_into ( ) {
1284
1284
let result = file. set_len ( length) ;
1285
- drop ( file_descriptor ) ;
1285
+ drop ( file_description ) ;
1286
1286
let result = this. try_unwrap_io_result ( result. map ( |_| 0i32 ) ) ?;
1287
1287
Ok ( Scalar :: from_i32 ( result) )
1288
1288
} else {
1289
- drop ( file_descriptor ) ;
1289
+ drop ( file_description ) ;
1290
1290
let einval = this. eval_libc ( "EINVAL" ) ;
1291
1291
this. set_last_error ( einval) ?;
1292
1292
Ok ( Scalar :: from_i32 ( -1 ) )
1293
1293
}
1294
1294
} else {
1295
- drop ( file_descriptor ) ;
1295
+ drop ( file_description ) ;
1296
1296
// The file is not writable
1297
1297
let einval = this. eval_libc ( "EINVAL" ) ;
1298
1298
this. set_last_error ( einval) ?;
@@ -1322,16 +1322,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1322
1322
1323
1323
fn ffullsync_fd ( & mut self , fd : i32 ) -> InterpResult < ' tcx , i32 > {
1324
1324
let this = self . eval_context_mut ( ) ;
1325
- let Some ( file_descriptor ) = this. machine . fds . get ( fd) else {
1325
+ let Some ( file_description ) = this. machine . fds . get ( fd) else {
1326
1326
return Ok ( this. fd_not_found ( ) ?) ;
1327
1327
} ;
1328
1328
// Only regular files support synchronization.
1329
1329
let FileHandle { file, writable } =
1330
- file_descriptor . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1330
+ file_description . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1331
1331
err_unsup_format ! ( "`fsync` is only supported on file-backed file descriptors" )
1332
1332
} ) ?;
1333
1333
let io_result = maybe_sync_file ( file, * writable, File :: sync_all) ;
1334
- drop ( file_descriptor ) ;
1334
+ drop ( file_description ) ;
1335
1335
this. try_unwrap_io_result ( io_result)
1336
1336
}
1337
1337
@@ -1347,16 +1347,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1347
1347
return this. fd_not_found ( ) ;
1348
1348
}
1349
1349
1350
- let Some ( file_descriptor ) = this. machine . fds . get ( fd) else {
1350
+ let Some ( file_description ) = this. machine . fds . get ( fd) else {
1351
1351
return Ok ( this. fd_not_found ( ) ?) ;
1352
1352
} ;
1353
1353
// Only regular files support synchronization.
1354
1354
let FileHandle { file, writable } =
1355
- file_descriptor . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1355
+ file_description . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1356
1356
err_unsup_format ! ( "`fdatasync` is only supported on file-backed file descriptors" )
1357
1357
} ) ?;
1358
1358
let io_result = maybe_sync_file ( file, * writable, File :: sync_data) ;
1359
- drop ( file_descriptor ) ;
1359
+ drop ( file_description ) ;
1360
1360
this. try_unwrap_io_result ( io_result)
1361
1361
}
1362
1362
@@ -1395,18 +1395,18 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1395
1395
return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
1396
1396
}
1397
1397
1398
- let Some ( file_descriptor ) = this. machine . fds . get ( fd) else {
1398
+ let Some ( file_description ) = this. machine . fds . get ( fd) else {
1399
1399
return Ok ( Scalar :: from_i32 ( this. fd_not_found ( ) ?) ) ;
1400
1400
} ;
1401
1401
// Only regular files support synchronization.
1402
1402
let FileHandle { file, writable } =
1403
- file_descriptor . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1403
+ file_description . downcast_ref :: < FileHandle > ( ) . ok_or_else ( || {
1404
1404
err_unsup_format ! (
1405
1405
"`sync_data_range` is only supported on file-backed file descriptors"
1406
1406
)
1407
1407
} ) ?;
1408
1408
let io_result = maybe_sync_file ( file, * writable, File :: sync_data) ;
1409
- drop ( file_descriptor ) ;
1409
+ drop ( file_description ) ;
1410
1410
Ok ( Scalar :: from_i32 ( this. try_unwrap_io_result ( io_result) ?) )
1411
1411
}
1412
1412
@@ -1702,11 +1702,11 @@ impl FileMetadata {
1702
1702
ecx : & mut MiriInterpCx < ' tcx > ,
1703
1703
fd : i32 ,
1704
1704
) -> InterpResult < ' tcx , Option < FileMetadata > > {
1705
- let Some ( file_descriptor ) = ecx. machine . fds . get ( fd) else {
1705
+ let Some ( file_description ) = ecx. machine . fds . get ( fd) else {
1706
1706
return ecx. fd_not_found ( ) . map ( |_: i32 | None ) ;
1707
1707
} ;
1708
1708
1709
- let file = & file_descriptor
1709
+ let file = & file_description
1710
1710
. downcast_ref :: < FileHandle > ( )
1711
1711
. ok_or_else ( || {
1712
1712
err_unsup_format ! (
@@ -1716,7 +1716,7 @@ impl FileMetadata {
1716
1716
. file ;
1717
1717
1718
1718
let metadata = file. metadata ( ) ;
1719
- drop ( file_descriptor ) ;
1719
+ drop ( file_description ) ;
1720
1720
FileMetadata :: from_meta ( ecx, metadata)
1721
1721
}
1722
1722
0 commit comments