diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2020-12-24 13:43:22 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2020-12-24 14:34:40 +0900 |
commit | 8e1c0b2f93abe23f42bd7eba0a3f0d3f3669e486 (patch) | |
tree | 03944274f80d3630a20dd8e3c98dc7d780c8084d /dir.c | |
parent | e43b5aa52dcd1eaded1141ab85a30bc8c7c4a6e4 (diff) | |
download | ruby-8e1c0b2f93abe23f42bd7eba0a3f0d3f3669e486.tar.gz |
dir.c: chdir conflict should raise only when called in different thread
... and keep it as a warning (like 2.7) when it is called in the same
thread. [Bug #15661]
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1064,8 +1064,10 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj) } if (chdir_blocking > 0) { - if (!rb_block_given_p() || rb_thread_current() != chdir_thread) + if (rb_thread_current() != chdir_thread) rb_raise(rb_eRuntimeError, "conflicting chdir during another chdir block"); + if (!rb_block_given_p()) + rb_warn("conflicting chdir during another chdir block"); } if (rb_block_given_p()) { |