Skip to content

Commit 27cd75f

Browse files
committed
Fix leaking file descriptor for Ruby 3.4
1 parent 697c22e commit 27cd75f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

library/net-ftp/mkdir_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
after :each do
1515
@ftp.quit rescue nil
16-
@ftp.close
16+
@ftp.close rescue nil
1717
@server.stop
1818
end
1919

library/net-ftp/mtime_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
after :each do
1515
@ftp.quit rescue nil
16-
@ftp.close
16+
@ftp.close rescue nil
1717
@server.stop
1818
end
1919

library/socket/socket/connect_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
client.connect(address)
6868
rescue Errno::ECONNREFUSED
6969
skip "Outgoing packets may be filtered"
70+
ensure
71+
client.close if client
7072
end
7173
}.should raise_error(IO::TimeoutError)
7274
end

0 commit comments

Comments
 (0)