ruby-changes:41517
From: nobu <ko1@a...>
Date: Tue, 19 Jan 2016 17:35:25 +0900 (JST)
Subject: [ruby-changes:41517] nobu:r53591 (trunk): io.c: suppress warning
nobu 2016-01-19 17:36:02 +0900 (Tue, 19 Jan 2016) New Revision: 53591 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53591 Log: io.c: suppress warning * io.c (rb_update_max_fd): get rid of unused-value warning. Modified files: trunk/io.c Index: io.c =================================================================== --- io.c (revision 53590) +++ io.c (revision 53591) @@ -197,16 +197,17 @@ rb_update_max_fd(int fd) https://github.com/ruby/ruby/blob/trunk/io.c#L197 { struct stat buf; rb_atomic_t afd = (rb_atomic_t)fd; + rb_atomic_t max_fd = max_file_descriptor; - if (afd <= max_file_descriptor) + if (afd <= max_fd) return; if (fstat(fd, &buf) != 0 && errno == EBADF) { rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd); } - while (max_file_descriptor < afd) { - ATOMIC_CAS(max_file_descriptor, max_file_descriptor, afd); + while (max_fd < afd) { + max_fd = ATOMIC_CAS(max_file_descriptor, max_fd, afd); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/