summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-04 13:02:45 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-04 13:02:45 +0000
commitff077097774f94b7b69b8d0ebcdea2638e906ec0 (patch)
tree1a8070f2f13862b5572fadc0850fd9f70ba257e7
parent62374161f1627843294f4f3836af085dd70eaa59 (diff)
* io.c (io_cntl): change 'cmd' type to int. ioctl and fcntl need to
be passed int. * io.c (rb_io_ctl): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--io.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 10a011d83d..531941551d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Mar 4 22:01:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (io_cntl): change 'cmd' type to int. ioctl and fcntl need to
+ be passed int.
+ * io.c (rb_io_ctl): ditto.
+
Fri Mar 4 21:10:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* configure.in: save warnflags. the patch is created by Eric Wong.
diff --git a/io.c b/io.c
index 82b8469d40..f023382ae5 100644
--- a/io.c
+++ b/io.c
@@ -7650,7 +7650,7 @@ rb_f_select(int argc, VALUE *argv, VALUE obj)
}
static int
-io_cntl(int fd, unsigned long cmd, long narg, int io_p)
+io_cntl(int fd, int cmd, long narg, int io_p)
{
int retval;
@@ -7658,7 +7658,7 @@ io_cntl(int fd, unsigned long cmd, long narg, int io_p)
# if defined(__CYGWIN__)
retval = io_p?ioctl(fd, cmd, (void*)narg):fcntl(fd, cmd, narg);
# else
- retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, (int)cmd, narg);
+ retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, cmd, narg);
# endif
# if defined(F_DUPFD)
if (!io_p && retval != -1 && cmd == F_DUPFD) {
@@ -7677,7 +7677,7 @@ io_cntl(int fd, unsigned long cmd, long narg, int io_p)
static VALUE
rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
{
- unsigned long cmd = NUM2ULONG(req);
+ int cmd = NUM2INT(req);
rb_io_t *fptr;
long len = 0;
long narg = 0;