ruby-changes:21536
From: akr <ko1@a...>
Date: Mon, 31 Oct 2011 21:49:30 +0900 (JST)
Subject: [ruby-changes:21536] akr:r33585 (trunk): * include/ruby/intern.h (rb_fd_fix_cloexec): renamed from
akr 2011-10-31 21:49:16 +0900 (Mon, 31 Oct 2011) New Revision: 33585 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33585 Log: * include/ruby/intern.h (rb_fd_fix_cloexec): renamed from rb_fd_set_cloexec. * io.c: follow the above renaming. * ext/pty/pty.c: ditto. * ext/socket/init.c: ditto. * ext/socket/socket.c: ditto. * ext/socket/ancdata.c: ditto. * ext/socket/unixsocket.c: ditto. Modified files: trunk/ChangeLog trunk/ext/pty/pty.c trunk/ext/socket/ancdata.c trunk/ext/socket/init.c trunk/ext/socket/socket.c trunk/ext/socket/unixsocket.c trunk/include/ruby/intern.h trunk/io.c Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 33584) +++ include/ruby/intern.h (revision 33585) @@ -509,7 +509,7 @@ int rb_cloexec_fcntl_dupfd(int fd, int minfd); #define RB_RESERVED_FD_P(fd) rb_reserved_fd_p(fd) void rb_update_max_fd(int fd); -void rb_fd_set_cloexec(int fd); +void rb_fd_fix_cloexec(int fd); /* marshal.c */ VALUE rb_marshal_dump(VALUE, VALUE); VALUE rb_marshal_load(VALUE); Index: ChangeLog =================================================================== --- ChangeLog (revision 33584) +++ ChangeLog (revision 33585) @@ -1,3 +1,20 @@ +Mon Oct 31 21:47:48 2011 Tanaka Akira <akr@f...> + + * include/ruby/intern.h (rb_fd_fix_cloexec): renamed from + rb_fd_set_cloexec. + + * io.c: follow the above renaming. + + * ext/pty/pty.c: ditto. + + * ext/socket/init.c: ditto. + + * ext/socket/socket.c: ditto. + + * ext/socket/ancdata.c: ditto. + + * ext/socket/unixsocket.c: ditto. + Mon Oct 31 21:02:43 2011 Tanaka Akira <akr@f...> * lib/resolv.rb (Resolv::DNS): retry IO.select for premature wakeup. Index: io.c =================================================================== --- io.c (revision 33584) +++ io.c (revision 33585) @@ -165,7 +165,7 @@ int flags, flags2, ret; flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */ if (flags == -1) { - rb_bug("rb_fd_set_cloexec: fcntl(%d, F_GETFD) failed: %s", fd, strerror(errno)); + rb_bug("fd_set_cloexec: fcntl(%d, F_GETFD) failed: %s", fd, strerror(errno)); } if (fd <= 2) flags2 = flags & ~FD_CLOEXEC; /* Clear CLOEXEC for standard file descriptors: 0, 1, 2. */ @@ -174,14 +174,14 @@ if (flags != flags2) { ret = fcntl(fd, F_SETFD, flags2); if (ret == -1) { - rb_bug("rb_fd_set_cloexec: fcntl(%d, F_SETFD, %d) failed: %s", fd, flags2, strerror(errno)); + rb_bug("fd_set_cloexec: fcntl(%d, F_SETFD, %d) failed: %s", fd, flags2, strerror(errno)); } } #endif } void -rb_fd_set_cloexec(int fd) +rb_fd_fix_cloexec(int fd) { fd_set_cloexec(fd); if (max_file_descriptor < fd) max_file_descriptor = fd; Index: ext/pty/pty.c =================================================================== --- ext/pty/pty.c (revision 33584) +++ ext/pty/pty.c (revision 33585) @@ -296,7 +296,7 @@ if ((masterfd = posix_openpt(O_RDWR|O_NOCTTY)) == -1) goto error; if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error; if (grantpt(masterfd) == -1) goto grantpt_error; - rb_fd_set_cloexec(masterfd); + rb_fd_fix_cloexec(masterfd); #else flags = O_RDWR|O_NOCTTY; # ifdef O_CLOEXEC @@ -306,7 +306,7 @@ flags |= O_CLOEXEC; # endif if ((masterfd = posix_openpt(flags)) == -1) goto error; - rb_fd_set_cloexec(masterfd); + rb_fd_fix_cloexec(masterfd); if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error; if (grantpt(masterfd) == -1) goto grantpt_error; #endif @@ -347,8 +347,8 @@ if (!fail) return -1; rb_raise(rb_eRuntimeError, "openpty() failed"); } - rb_fd_set_cloexec(*master); - rb_fd_set_cloexec(*slave); + rb_fd_fix_cloexec(*master); + rb_fd_fix_cloexec(*slave); if (no_mesg(SlaveName, nomesg) == -1) { if (!fail) return -1; rb_raise(rb_eRuntimeError, "can't chmod slave pty"); @@ -365,7 +365,7 @@ if (!fail) return -1; rb_raise(rb_eRuntimeError, "_getpty() failed"); } - rb_fd_set_cloexec(*master); + rb_fd_fix_cloexec(*master); *slave = rb_cloexec_open(name, O_RDWR, 0); /* error check? */ @@ -387,7 +387,7 @@ if((masterfd = open("/dev/ptmx", O_RDWR, 0)) == -1) goto error; s = signal(SIGCHLD, SIG_DFL); if(grantpt(masterfd) == -1) goto error; - rb_fd_set_cloexec(masterfd); + rb_fd_fix_cloexec(masterfd); #else if((masterfd = rb_cloexec_open("/dev/ptmx", O_RDWR, 0)) == -1) goto error; rb_update_max_fd(masterfd); Index: ext/socket/init.c =================================================================== --- ext/socket/init.c (revision 33584) +++ ext/socket/init.c (revision 33585) @@ -252,7 +252,7 @@ } } if (0 <= fd) - rb_fd_set_cloexec(fd); + rb_fd_fix_cloexec(fd); return fd; } @@ -466,7 +466,7 @@ } rb_sys_fail("accept(2)"); } - rb_fd_set_cloexec(fd2); + rb_fd_fix_cloexec(fd2); make_fd_nonblock(fd2); return rsock_init_sock(rb_obj_alloc(klass), fd2); } @@ -513,7 +513,7 @@ } rb_sys_fail(0); } - rb_fd_set_cloexec(fd2); + rb_fd_fix_cloexec(fd2); if (!klass) return INT2NUM(fd2); return rsock_init_sock(rb_obj_alloc(klass), fd2); } Index: ext/socket/socket.c =================================================================== --- ext/socket/socket.c (revision 33584) +++ ext/socket/socket.c (revision 33585) @@ -119,8 +119,8 @@ if (ret < 0) { rb_sys_fail("socketpair(2)"); } - rb_fd_set_cloexec(sp[0]); - rb_fd_set_cloexec(sp[1]); + rb_fd_fix_cloexec(sp[0]); + rb_fd_fix_cloexec(sp[1]); s1 = rsock_init_sock(rb_obj_alloc(klass), sp[0]); s2 = rsock_init_sock(rb_obj_alloc(klass), sp[1]); Index: ext/socket/ancdata.c =================================================================== --- ext/socket/ancdata.c (revision 33584) +++ ext/socket/ancdata.c (revision 33585) @@ -1396,7 +1396,7 @@ int *end = (int *)((char *)cmh + cmh->cmsg_len); while ((char *)fdp + sizeof(int) <= (char *)end && (char *)fdp + sizeof(int) <= msg_end) { - rb_fd_set_cloexec(*fdp); + rb_fd_fix_cloexec(*fdp); close(*fdp); fdp++; } @@ -1439,7 +1439,7 @@ VALUE io; if (fstat(fd, &stbuf) == -1) rb_raise(rb_eSocket, "invalid fd in SCM_RIGHTS"); - rb_fd_set_cloexec(fd); + rb_fd_fix_cloexec(fd); if (S_ISSOCK(stbuf.st_mode)) io = rsock_init_sock(rb_obj_alloc(rb_cSocket), fd); else Index: ext/socket/unixsocket.c =================================================================== --- ext/socket/unixsocket.c (revision 33584) +++ ext/socket/unixsocket.c (revision 33585) @@ -383,7 +383,7 @@ #if FD_PASSING_BY_MSG_CONTROL memcpy(&fd, CMSG_DATA(&cmsg.hdr), sizeof(int)); #endif - rb_fd_set_cloexec(fd); + rb_fd_fix_cloexec(fd); if (klass == Qnil) return INT2FIX(fd); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/