[ruby-cvs:57671] normal:r50523 (trunk): lib/webrick/utils.rb: simplify by avoiding fcntl

normal at ruby-lang.org normal at ruby-lang.org
Sun May 17 17:22:12 JST 2015

normal	2015-05-17 17:22:11 +0900 (Sun, 17 May 2015)

  New Revision: 50523


    lib/webrick/utils.rb: simplify by avoiding fcntl
    IO#nonblock= and IO#close_on_exec= methods are simpler-to-use
    and potentially more portable to for future OSes.
    IO#nonblock= and IO#close_on_exec= are also smart enough to avoid
    redundantly setting flags so a syscall may be avoided.
    These methods could probably be removed entirely and inlined, but
    it's unclear if there is 3rd-party code which relies on them.
    * lib/webrick/utils.rb (set_non_blocking): use IO#nonblock=
    * (set_close_on_exec): use IO#close_on_exec=
      [Feature #11136]

  Modified files:

More information about the ruby-cvs mailing list