mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (rb_cloexec_fcntl_dupfd): improve #ifdef condition.
* io.c (rb_maygvl_fd_fix_cloexec): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
da9fe1c452
commit
753f68cf20
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Jan 5 08:21:41 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* io.c (rb_cloexec_fcntl_dupfd): improve #ifdef condition.
|
||||||
|
* io.c (rb_maygvl_fd_fix_cloexec): ditto.
|
||||||
|
|
||||||
Sat Jan 5 07:54:59 2013 Eric Hodel <drbrain@segment7.net>
|
Sat Jan 5 07:54:59 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/rubygems/commands/cleanup_command.rb: Clean all possible gems
|
* lib/rubygems/commands/cleanup_command.rb: Clean all possible gems
|
||||||
|
|
6
io.c
6
io.c
|
@ -168,7 +168,7 @@ void
|
||||||
rb_maygvl_fd_fix_cloexec(int fd)
|
rb_maygvl_fd_fix_cloexec(int fd)
|
||||||
{
|
{
|
||||||
/* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */
|
/* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */
|
||||||
#if defined(F_GETFD) && !defined(__native_client__)
|
#if defined(HAVE_FCNTL) && defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC) && !defined(__native_client__)
|
||||||
int flags, flags2, ret;
|
int flags, flags2, ret;
|
||||||
flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
|
flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
|
||||||
if (flags == -1) {
|
if (flags == -1) {
|
||||||
|
@ -298,7 +298,7 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#if defined(HAVE_FCNTL) && defined(F_DUPFD_CLOEXEC) && !defined(__native_client__)
|
#if defined(HAVE_FCNTL) && defined(F_DUPFD_CLOEXEC) && defined(F_DUPFD) && !defined(__native_client__)
|
||||||
static int try_dupfd_cloexec = 1;
|
static int try_dupfd_cloexec = 1;
|
||||||
if (try_dupfd_cloexec) {
|
if (try_dupfd_cloexec) {
|
||||||
ret = fcntl(fd, F_DUPFD_CLOEXEC, minfd);
|
ret = fcntl(fd, F_DUPFD_CLOEXEC, minfd);
|
||||||
|
@ -318,7 +318,7 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
|
||||||
else {
|
else {
|
||||||
ret = fcntl(fd, F_DUPFD, minfd);
|
ret = fcntl(fd, F_DUPFD, minfd);
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_FCNTL) && !defined(__native_client__)
|
#elif defined(HAVE_FCNTL) && defined(F_DUPFD) && !defined(__native_client__)
|
||||||
ret = fcntl(fd, F_DUPFD, minfd);
|
ret = fcntl(fd, F_DUPFD, minfd);
|
||||||
#else
|
#else
|
||||||
ret = dup2(fd, minfd);
|
ret = dup2(fd, minfd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue