diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/pty/pty.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Sun Feb 28 21:32:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ext/pty/pty.c (get_device_once): raise on error when fail is + non-zero. + Sun Feb 28 18:58:00 2010 Kenta Murata <mrkn@mrkn.jp> * math.c (rb_eMathDomainError): new exception class diff --git a/ext/pty/pty.c b/ext/pty/pty.c index a94d2f249f..cd7aa88f77 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -319,7 +319,7 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg, error: if (slavefd != -1) close(slavefd); if (masterfd != -1) close(masterfd); - if (!fail) { + if (fail) { rb_raise(rb_eRuntimeError, "can't get Master/Slave device"); } return -1; @@ -383,7 +383,7 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg, error: if (slavefd != -1) close(slavefd); if (masterfd != -1) close(masterfd); - if (!fail) rb_raise(rb_eRuntimeError, "can't get Master/Slave device"); + if (fail) rb_raise(rb_eRuntimeError, "can't get Master/Slave device"); return -1; #else int masterfd = -1, slavefd = -1; |