Skip to content

Commit 32a813b

Browse files
committed
Get rid of Pitchfork.pipe
We no longer need it.
1 parent cdef93b commit 32a813b

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

lib/pitchfork.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -120,25 +120,6 @@ def log_error(logger, prefix, exc)
120120
exc.backtrace.each { |line| logger.error(line) }
121121
end
122122

123-
F_SETPIPE_SZ = 1031 if RUBY_PLATFORM =~ /linux/
124-
125-
def pipe # :nodoc:
126-
IO.pipe.each do |io|
127-
# shrink pipes to minimize impact on /proc/sys/fs/pipe-user-pages-soft
128-
# limits.
129-
if defined?(F_SETPIPE_SZ)
130-
begin
131-
io.fcntl(F_SETPIPE_SZ, Raindrops::PAGE_SIZE)
132-
rescue Errno::EINVAL
133-
# old kernel
134-
rescue Errno::EPERM
135-
# resizes fail if Linux is close to the pipe limit for the user
136-
# or if the user does not have permissions to resize
137-
end
138-
end
139-
end
140-
end
141-
142123
def socketpair
143124
pair = UNIXSocket.socketpair(@socket_type).map { |s| MessageSocket.new(s) }
144125
pair[0].close_write

test/unit/test_util.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_socketpair
1616
end
1717

1818
def test_pipe
19-
r, w = Pitchfork.pipe
19+
r, w = IO.pipe
2020
assert r
2121
assert w
2222

@@ -45,7 +45,7 @@ def test_message_socket
4545
child, parent = Pitchfork.socketpair
4646
child_pid = fork do
4747
parent.sendmsg('just text')
48-
read, write = Pitchfork.pipe
48+
read, write = IO.pipe
4949
message = TestMessage.new('rich message', write)
5050
parent.sendmsg(message)
5151
write.close

0 commit comments

Comments
 (0)