ruby-changes:46616
From: nobu <ko1@a...>
Date: Mon, 15 May 2017 20:19:32 +0900 (JST)
Subject: [ruby-changes:46616] nobu:r58731 (trunk): io_spec.c: suppress unused-variable warning
nobu 2017-05-15 20:19:12 +0900 (Mon, 15 May 2017) New Revision: 58731 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58731 Log: io_spec.c: suppress unused-variable warning Modified files: trunk/spec/rubyspec/optional/capi/ext/io_spec.c Index: spec/rubyspec/optional/capi/ext/io_spec.c =================================================================== --- spec/rubyspec/optional/capi/ext/io_spec.c (revision 58730) +++ spec/rubyspec/optional/capi/ext/io_spec.c (revision 58731) @@ -11,13 +11,13 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/ext/io_spec.c#L11 #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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/