@@ -101,6 +101,8 @@ fn test_mkfifo_directory() {
101101#[ test]
102102#[ cfg( not( any( target_os = "macos" , target_os = "ios" , target_os = "android" ) ) ) ]
103103fn test_mkfifoat_none ( ) {
104+ let _m = :: CWD_LOCK . read ( ) . expect ( "Mutex got poisoned by another test" ) ;
105+
104106 let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
105107 let mkfifoat_fifo = tempdir. path ( ) . join ( "mkfifoat_fifo" ) ;
106108
@@ -128,11 +130,10 @@ fn test_mkfifoat() {
128130#[ test]
129131#[ cfg( not( any( target_os = "macos" , target_os = "ios" , target_os = "android" ) ) ) ]
130132fn test_mkfifoat_directory_none ( ) {
133+ let _m = :: CWD_LOCK . read ( ) . expect ( "Mutex got poisoned by another test" ) ;
134+
131135 // mkfifoat should fail if a directory is given
132- assert_eq ! (
133- mkfifoat( None , & env:: temp_dir( ) , Mode :: S_IRUSR ) . is_ok( ) ,
134- false
135- ) ;
136+ assert ! ( !mkfifoat( None , & env:: temp_dir( ) , Mode :: S_IRUSR ) . is_ok( ) ) ;
136137}
137138
138139#[ test]
@@ -144,10 +145,7 @@ fn test_mkfifoat_directory() {
144145 let mkfifoat_dir = "mkfifoat_dir" ;
145146 stat:: mkdirat ( dirfd, mkfifoat_dir, Mode :: S_IRUSR ) . unwrap ( ) ;
146147
147- assert_eq ! (
148- mkfifoat( Some ( dirfd) , mkfifoat_dir, Mode :: S_IRUSR ) . is_ok( ) ,
149- false
150- ) ;
148+ assert ! ( !mkfifoat( Some ( dirfd) , mkfifoat_dir, Mode :: S_IRUSR ) . is_ok( ) ) ;
151149}
152150
153151#[ test]
@@ -637,6 +635,8 @@ fn test_canceling_alarm() {
637635
638636#[ test]
639637fn test_symlinkat ( ) {
638+ let _m = :: CWD_LOCK . read ( ) . expect ( "Mutex got poisoned by another test" ) ;
639+
640640 let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
641641
642642 let target = tempdir. path ( ) . join ( "a" ) ;
@@ -682,6 +682,8 @@ fn test_linkat_file() {
682682
683683#[ test]
684684fn test_linkat_olddirfd_none ( ) {
685+ let _dr = :: DirRestore :: new ( ) ;
686+
685687 let tempdir_oldfile = tempfile:: tempdir ( ) . unwrap ( ) ;
686688 let oldfilename = "foo.txt" ;
687689 let oldfilepath = tempdir_oldfile. path ( ) . join ( oldfilename) ;
@@ -704,6 +706,8 @@ fn test_linkat_olddirfd_none() {
704706
705707#[ test]
706708fn test_linkat_newdirfd_none ( ) {
709+ let _dr = :: DirRestore :: new ( ) ;
710+
707711 let tempdir_oldfile = tempfile:: tempdir ( ) . unwrap ( ) ;
708712 let oldfilename = "foo.txt" ;
709713 let oldfilepath = tempdir_oldfile. path ( ) . join ( oldfilename) ;
@@ -727,6 +731,8 @@ fn test_linkat_newdirfd_none() {
727731#[ test]
728732#[ cfg( not( any( target_os = "ios" , target_os = "macos" ) ) ) ]
729733fn test_linkat_no_follow_symlink ( ) {
734+ let _m = :: CWD_LOCK . read ( ) . expect ( "Mutex got poisoned by another test" ) ;
735+
730736 let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
731737 let oldfilename = "foo.txt" ;
732738 let oldfilepath = tempdir. path ( ) . join ( oldfilename) ;
@@ -761,6 +767,8 @@ fn test_linkat_no_follow_symlink() {
761767
762768#[ test]
763769fn test_linkat_follow_symlink ( ) {
770+ let _m = :: CWD_LOCK . read ( ) . expect ( "Mutex got poisoned by another test" ) ;
771+
764772 let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
765773 let oldfilename = "foo.txt" ;
766774 let oldfilepath = tempdir. path ( ) . join ( oldfilename) ;
0 commit comments