mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6533f070ba
commit
1a70dfe6f4
8 changed files with 35 additions and 18 deletions
6
io.c
6
io.c
|
@ -165,7 +165,7 @@ fd_set_cloexec(int fd)
|
|||
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 @@ fd_set_cloexec(int fd)
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue