Skip to content

Commit 81e8a6c

Browse files
committed
* ext/socket: revert r44943 because it causes errors on some linux
platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent a81c95f commit 81e8a6c

6 files changed

Lines changed: 10 additions & 21 deletions

File tree

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Fri Feb 14 21:01:12 2014 NAKAMURA Usaku <usa@ruby-lang.org>
2+
3+
* ext/socket: revert r44943 because it causes errors on some linux
4+
platforms.
5+
16
Fri Feb 14 20:52:31 2014 NAKAMURA Usaku <usa@ruby-lang.org>
27

38
* configure.in (ARCH_FLAG): __sync_val_compare_and_swap_4 needs

ext/socket/basicsocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
566566
GetOpenFile(sock, fptr);
567567
arg.fd = fptr->fd;
568568
arg.flags = NUM2INT(flags);
569-
while (rsock_maybe_fd_writable(arg.fd),
569+
while (rb_thread_fd_writable(arg.fd),
570570
(n = (int)BLOCKING_REGION_FD(func, &arg)) < 0) {
571571
if (rb_io_wait_writable(arg.fd)) {
572572
continue;

ext/socket/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
129129
RBASIC(str)->klass = 0;
130130

131131
while (rb_io_check_closed(fptr),
132-
rsock_maybe_wait_fd(arg.fd),
132+
rb_thread_wait_fd(arg.fd),
133133
(slen = BLOCKING_REGION_FD(recvfrom_blocking, &arg)) < 0) {
134134
if (!rb_io_wait_readable(fptr->fd)) {
135135
rb_sys_fail("recvfrom(2)");
@@ -503,7 +503,7 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
503503
arg.sockaddr = sockaddr;
504504
arg.len = len;
505505
retry:
506-
rsock_maybe_wait_fd(fd);
506+
rb_thread_wait_fd(fd);
507507
fd2 = (int)BLOCKING_REGION_FD(accept_blocking, &arg);
508508
if (fd2 < 0) {
509509
switch (errno) {

ext/socket/rubysocket.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -306,20 +306,4 @@ void rsock_init_addrinfo(void);
306306
void rsock_init_sockopt(void);
307307
void rsock_init_socket_init(void);
308308

309-
/*
310-
* It is safe on Linux to attempt using a socket without waiting on it in
311-
* all cases. For some syscalls (e.g. accept/accept4), blocking on the
312-
* syscall instead of relying on select/poll allows the kernel to use
313-
* "wake-one" behavior and avoid the thundering herd problem.
314-
* This is likely safe on all other *nix-like systems, so this whitelist
315-
* can be expanded by interested parties.
316-
*/
317-
#if defined(__linux__)
318-
static inline int rsock_maybe_fd_writable(int fd) { return 1; }
319-
static inline void rsock_maybe_wait_fd(int fd) { }
320-
#else /* some systems (mswin/mingw) need these. ref: r36946 */
321-
# define rsock_maybe_fd_writable(fd) rb_thread_fd_writable((fd))
322-
# define rsock_maybe_wait_fd(fd) rb_thread_wait_fd((fd))
323-
#endif
324-
325309
#endif

ext/socket/udpsocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ udp_send(int argc, VALUE *argv, VALUE sock)
176176
retry:
177177
arg.to = res->ai_addr;
178178
arg.tolen = res->ai_addrlen;
179-
rsock_maybe_fd_writable(arg.fd);
179+
rb_thread_fd_writable(arg.fd);
180180
n = (int)BLOCKING_REGION_FD(rsock_sendto_blocking, &arg);
181181
if (n >= 0) {
182182
freeaddrinfo(res0);

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define RUBY_VERSION "1.9.3"
2-
#define RUBY_PATCHLEVEL 533
2+
#define RUBY_PATCHLEVEL 534
33

44
#define RUBY_RELEASE_DATE "2014-02-14"
55
#define RUBY_RELEASE_YEAR 2014

0 commit comments

Comments
 (0)