@@ -154,7 +154,7 @@ impl rtio::RtioFileStream for FileDesc {
154
154
155
155
fn fstat ( & mut self ) -> IoResult < rtio:: FileStat > {
156
156
let mut stat: libc:: stat = unsafe { mem:: zeroed ( ) } ;
157
- match retry ( || unsafe { libc:: fstat ( self . fd ( ) , & mut stat) } ) {
157
+ match unsafe { libc:: fstat ( self . fd ( ) , & mut stat) } {
158
158
0 => Ok ( mkstat ( & stat) ) ,
159
159
_ => Err ( super :: last_error ( ) ) ,
160
160
}
@@ -346,9 +346,7 @@ pub fn open(path: &CString, fm: rtio::FileMode, fa: rtio::FileAccess)
346
346
}
347
347
348
348
pub fn mkdir ( p : & CString , mode : uint ) -> IoResult < ( ) > {
349
- super :: mkerr_libc ( retry ( || unsafe {
350
- libc:: mkdir ( p. as_ptr ( ) , mode as libc:: mode_t )
351
- } ) )
349
+ super :: mkerr_libc ( unsafe { libc:: mkdir ( p. as_ptr ( ) , mode as libc:: mode_t ) } )
352
350
}
353
351
354
352
pub fn readdir ( p : & CString ) -> IoResult < Vec < CString > > {
@@ -393,13 +391,11 @@ pub fn readdir(p: &CString) -> IoResult<Vec<CString>> {
393
391
}
394
392
395
393
pub fn unlink ( p : & CString ) -> IoResult < ( ) > {
396
- super :: mkerr_libc ( retry ( || unsafe { libc:: unlink ( p. as_ptr ( ) ) } ) )
394
+ super :: mkerr_libc ( unsafe { libc:: unlink ( p. as_ptr ( ) ) } )
397
395
}
398
396
399
397
pub fn rename ( old : & CString , new : & CString ) -> IoResult < ( ) > {
400
- super :: mkerr_libc ( retry ( || unsafe {
401
- libc:: rename ( old. as_ptr ( ) , new. as_ptr ( ) )
402
- } ) )
398
+ super :: mkerr_libc ( unsafe { libc:: rename ( old. as_ptr ( ) , new. as_ptr ( ) ) } )
403
399
}
404
400
405
401
pub fn chmod ( p : & CString , mode : uint ) -> IoResult < ( ) > {
@@ -409,9 +405,7 @@ pub fn chmod(p: &CString, mode: uint) -> IoResult<()> {
409
405
}
410
406
411
407
pub fn rmdir ( p : & CString ) -> IoResult < ( ) > {
412
- super :: mkerr_libc ( retry ( || unsafe {
413
- libc:: rmdir ( p. as_ptr ( ) )
414
- } ) )
408
+ super :: mkerr_libc ( unsafe { libc:: rmdir ( p. as_ptr ( ) ) } )
415
409
}
416
410
417
411
pub fn chown ( p : & CString , uid : int , gid : int ) -> IoResult < ( ) > {
@@ -428,10 +422,10 @@ pub fn readlink(p: &CString) -> IoResult<CString> {
428
422
len = 1024 ; // FIXME: read PATH_MAX from C ffi?
429
423
}
430
424
let mut buf: Vec < u8 > = Vec :: with_capacity ( len as uint ) ;
431
- match retry ( || unsafe {
425
+ match unsafe {
432
426
libc:: readlink ( p, buf. as_ptr ( ) as * mut libc:: c_char ,
433
427
len as libc:: size_t ) as libc:: c_int
434
- } ) {
428
+ } {
435
429
-1 => Err ( super :: last_error ( ) ) ,
436
430
n => {
437
431
assert ! ( n > 0 ) ;
@@ -442,15 +436,11 @@ pub fn readlink(p: &CString) -> IoResult<CString> {
442
436
}
443
437
444
438
pub fn symlink ( src : & CString , dst : & CString ) -> IoResult < ( ) > {
445
- super :: mkerr_libc ( retry ( || unsafe {
446
- libc:: symlink ( src. as_ptr ( ) , dst. as_ptr ( ) )
447
- } ) )
439
+ super :: mkerr_libc ( unsafe { libc:: symlink ( src. as_ptr ( ) , dst. as_ptr ( ) ) } )
448
440
}
449
441
450
442
pub fn link ( src : & CString , dst : & CString ) -> IoResult < ( ) > {
451
- super :: mkerr_libc ( retry ( || unsafe {
452
- libc:: link ( src. as_ptr ( ) , dst. as_ptr ( ) )
453
- } ) )
443
+ super :: mkerr_libc ( unsafe { libc:: link ( src. as_ptr ( ) , dst. as_ptr ( ) ) } )
454
444
}
455
445
456
446
fn mkstat ( stat : & libc:: stat ) -> rtio:: FileStat {
@@ -489,15 +479,15 @@ fn mkstat(stat: &libc::stat) -> rtio::FileStat {
489
479
490
480
pub fn stat ( p : & CString ) -> IoResult < rtio:: FileStat > {
491
481
let mut stat: libc:: stat = unsafe { mem:: zeroed ( ) } ;
492
- match retry ( || unsafe { libc:: stat ( p. as_ptr ( ) , & mut stat) } ) {
482
+ match unsafe { libc:: stat ( p. as_ptr ( ) , & mut stat) } {
493
483
0 => Ok ( mkstat ( & stat) ) ,
494
484
_ => Err ( super :: last_error ( ) ) ,
495
485
}
496
486
}
497
487
498
488
pub fn lstat ( p : & CString ) -> IoResult < rtio:: FileStat > {
499
489
let mut stat: libc:: stat = unsafe { mem:: zeroed ( ) } ;
500
- match retry ( || unsafe { libc:: lstat ( p. as_ptr ( ) , & mut stat) } ) {
490
+ match unsafe { libc:: lstat ( p. as_ptr ( ) , & mut stat) } {
501
491
0 => Ok ( mkstat ( & stat) ) ,
502
492
_ => Err ( super :: last_error ( ) ) ,
503
493
}
@@ -508,9 +498,7 @@ pub fn utime(p: &CString, atime: u64, mtime: u64) -> IoResult<()> {
508
498
actime : ( atime / 1000 ) as libc:: time_t ,
509
499
modtime : ( mtime / 1000 ) as libc:: time_t ,
510
500
} ;
511
- super :: mkerr_libc ( retry ( || unsafe {
512
- libc:: utime ( p. as_ptr ( ) , & buf)
513
- } ) )
501
+ super :: mkerr_libc ( unsafe { libc:: utime ( p. as_ptr ( ) , & buf) } )
514
502
}
515
503
516
504
#[ cfg( test) ]
0 commit comments