[前][次][番号順一覧][スレッド一覧]

ruby-changes:33638

From: akr <ko1@a...>
Date: Fri, 25 Apr 2014 19:17:21 +0900 (JST)
Subject: [ruby-changes:33638] akr:r45719 (trunk): * lib/webrick/utils.rb: Don't rescue LoadError for 'etc' extension.

akr	2014-04-25 19:17:15 +0900 (Fri, 25 Apr 2014)

  New Revision: 45719

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45719

  Log:
    * lib/webrick/utils.rb: Don't rescue LoadError for 'etc' extension.

  Modified files:
    trunk/ChangeLog
    trunk/lib/webrick/utils.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45718)
+++ ChangeLog	(revision 45719)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Apr 25 19:16:30 2014  Tanaka Akira  <akr@f...>
+
+	* lib/webrick/utils.rb: Don't rescue LoadError for 'etc' extension.
+
 Fri Apr 25 14:55:59 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in (rb_cv_func___builtin_unreachable): try with an
Index: lib/webrick/utils.rb
===================================================================
--- lib/webrick/utils.rb	(revision 45718)
+++ lib/webrick/utils.rb	(revision 45719)
@@ -10,11 +10,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/webrick/utils.rb#L10
 
 require 'socket'
 require 'fcntl'
-begin
-  require 'etc'
-rescue LoadError
-  nil
-end
+require 'etc'
 
 module WEBrick
   module Utils
@@ -41,7 +37,7 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/utils.rb#L37
     ##
     # Changes the process's uid and gid to the ones of +user+
     def su(user)
-      if defined?(Etc) && (pw = Etc.getpwnam(user))
+      if pw = Etc.getpwnam(user)
         Process::initgroups(user, pw.gid)
         Process::Sys::setgid(pw.gid)
         Process::Sys::setuid(pw.uid)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]