diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-15 11:19:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-15 11:19:12 +0000 |
commit | 604e552525bcd189ef9386079272859aae49a173 (patch) | |
tree | eea17fde32a2b4e00f7bdab8c8148fd27c3abd20 /spec/rubyspec | |
parent | b4939106f3273b847c28263bfa7dc82b3b1f7194 (diff) | |
download | ruby-604e552525bcd189ef9386079272859aae49a173.tar.gz |
io_spec.c: suppress unused-variable warning
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/rubyspec')
-rw-r--r-- | spec/rubyspec/optional/capi/ext/io_spec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/rubyspec/optional/capi/ext/io_spec.c b/spec/rubyspec/optional/capi/ext/io_spec.c index 91d86f5827..491ceed9cb 100644 --- a/spec/rubyspec/optional/capi/ext/io_spec.c +++ b/spec/rubyspec/optional/capi/ext/io_spec.c @@ -11,13 +11,13 @@ extern "C" { #endif static int set_non_blocking(int fd) { - int flags; #if defined(O_NONBLOCK) && defined(F_GETFL) - if (-1 == (flags = fcntl(fd, F_GETFL, 0))) + int flags = fcntl(fd, F_GETFL, 0); + if (flags == -1) flags = 0; return fcntl(fd, F_SETFL, flags | O_NONBLOCK); #elif defined(FIOBIO) - flags = 1; + int flags = 1; return ioctl(fd, FIOBIO, &flags); #else errno = ENOSYS; |