mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* win32/win32.c (rb_w32_read): fix an issue that $stdin.read doesn't
terminate by CTRL-C on Windows. [ruby-dev:45149] [Bug #5812] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									bb65920642
								
							
						
					
					
						commit
						a65f6649dd
					
				
					 2 changed files with 12 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,9 @@
 | 
			
		|||
Sat Jan 28 09:33:33 2012  Hiroshi Shirosaki  <h.shirosaki@gmail.com>
 | 
			
		||||
 | 
			
		||||
	* win32/win32.c (rb_w32_read): fix an issue that $stdin.read doesn't
 | 
			
		||||
	  terminate by CTRL-C on Windows.
 | 
			
		||||
	  [ruby-dev:45149] [Bug #5812]
 | 
			
		||||
 | 
			
		||||
Sat Jan 28 08:18:11 2012  Hiroshi Shirosaki  <h.shirosaki@gmail.com>
 | 
			
		||||
 | 
			
		||||
	* test/ruby/test_thread.rb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5575,6 +5575,10 @@ rb_w32_read(int fd, void *buf, size_t size)
 | 
			
		|||
	    }
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
	err = GetLastError();
 | 
			
		||||
	errno = map_errno(err);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (pol) {
 | 
			
		||||
	CloseHandle(ol.hEvent);
 | 
			
		||||
| 
						 | 
				
			
			@ -5591,7 +5595,8 @@ rb_w32_read(int fd, void *buf, size_t size)
 | 
			
		|||
    ret += read;
 | 
			
		||||
    if (read >= len) {
 | 
			
		||||
	buf = (char *)buf + read;
 | 
			
		||||
	if (!(isconsole && len == 1 && (!islineinput || *((char *)buf - 1) == '\n')) && size > 0)
 | 
			
		||||
	if (err != ERROR_OPERATION_ABORTED &&
 | 
			
		||||
	    !(isconsole && len == 1 && (!islineinput || *((char *)buf - 1) == '\n')) && size > 0)
 | 
			
		||||
	    goto retry;
 | 
			
		||||
    }
 | 
			
		||||
    if (read == 0)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue