Bug #9571

"Error: TestFileUtils#test_rmdir: Errno::EEXIST: File exists @ dir_s_rmdir - data" on Solaris

Added by Naohisa Goto over 1 year ago. Updated 11 months ago.

[ruby-dev:48017]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 2.2.0dev (2014-02-26) [sparc64-solaris2.10] Backport:2.0.0: DONE, 2.1: DONE

Description

Solarisにて、いつからかは忘れましたが、make test-all にて以下のErrorが生じています。

52) Error:
TestFileUtils#test_rmdir:
Errno::EEXIST: File exists @ dir_s_rmdir - data
/XXXXX/lib/fileutils.rb:277:in `rmdir'
/XXXXX/lib/fileutils.rb:277:in `block in rmdir'
/XXXXX/lib/fileutils.rb:271:in `each'
/XXXXX/lib/fileutils.rb:271:in `rmdir'
/XXXXX/test/fileutils/test_fileutils.rb:1380:in `block in test_rmdir'
/XXXXX/lib/test/unit/assertions.rb:166:in `assert_nothing_raised'
/XXXXX/test/fileutils/test_fileutils.rb:1379:in `test_rmdir'

Solaris では、中身が残っているディレクトリをrmdirしようとしたとき、errno に EEXIST をセットします。
http://docs.oracle.com/cd/E23824_01/html/821-1463/rmdir-2.html

$ irb
irb(main):001:0> Dir.mkdir('aaa')
=> 0
irb(main):002:0> Dir.mkdir('aaa/bbb')
=> 0
irb(main):003:0> Dir.rmdir('aaa')
Errno::EEXIST: File exists - aaa
from (irb):3:in `rmdir'
from (irb):3
from /usr/local/64/bin/irb:12:in `<main>'
irb(main):004:0> 

SunOS 4 では ENOTEMPTY を使用していたが Solaris では EEXIST に変更になったとの記述も見つけました。
http://docs.oracle.com/cd/E19455-01/806-2724/6jbu1b2ck/index.html

しかし、fileutils.rbのrmdirは、これに対応していないため、エラーになるようです。

Associated revisions

Revision 45720
Added by Naohisa Goto over 1 year ago

  • lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the directory is not an empty directory, rmdir() shall fail and set errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST. [Bug #9571]

Revision 45720
Added by Naohisa Goto over 1 year ago

  • lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the directory is not an empty directory, rmdir() shall fail and set errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST. [Bug #9571]

Revision 46910
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) r45720: [Backport #9571]

* lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
  ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the
  directory is not an empty directory, rmdir() shall fail and set
  errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST.
  [Bug #9571] 

Revision 47336
Added by Usaku NAKAMURA 11 months ago

merge revision(s) 45720: [Backport #9571]

* lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
  ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the
  directory is not an empty directory, rmdir() shall fail and set
  errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST.
  [Bug #9571] 

History

#1 Updated by Naohisa Goto over 1 year ago

SUSv3 に以下の記述があり、Solaris以外でもエラーになるOSがあるかもしれません。

If the directory is not an empty directory, rmdir() shall fail and set errno to [EEXIST] or [ENOTEMPTY].

http://pubs.opengroup.org/onlinepubs/000095399/functions/rmdir.html

#2 Updated by Naohisa Goto over 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45720.


  • lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the directory is not an empty directory, rmdir() shall fail and set errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST. [Bug #9571]

#3 Updated by Usaku NAKAMURA about 1 year ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: REQUIRED, 2.0.0: UNKNOWN, 2.1: REQUIRED

#4 Updated by Tomoyuki Chikanaga about 1 year ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: UNKNOWN, 2.1: REQUIRED to 1.9.3: REQUIRED, 2.0.0: UNKNOWN, 2.1: DONE

Backported into ruby_2_1 branch at r46910.

#5 Updated by Usaku NAKAMURA 11 months ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: UNKNOWN, 2.1: DONE to 2.0.0: DONE, 2.1: DONE

backported into ruby_2_0_0 at r47336.

Also available in: Atom PDF