diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | file.c | 3 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Wed Mar 5 17:53:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * file.c (rb_file_flock): returns false on EAGAIN if non-blocking. + [ruby-core:15795] + Web Mar 5 17:43:43 2008 Martin Duerst <duerst@it.aoyama.ac.jp> * transcode.c (transcode_loop): Adjusted detection of invalid @@ -3273,7 +3273,7 @@ rb_file_flock(VALUE obj, VALUE operation) #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN case EWOULDBLOCK: #endif - if (op1 & LOCK_NB) goto exit; + if (op1 & LOCK_NB) return Qfalse; rb_thread_polling(); rb_io_check_closed(fptr); continue; @@ -3288,7 +3288,6 @@ rb_file_flock(VALUE obj, VALUE operation) rb_sys_fail(fptr->path); } } - exit: #endif return INT2FIX(0); } |