* eval.c, intern.h: failed to compile where NFDBITS is defined but

howmany() is not defined. [ruby-dev:27680]

* io.c (is_socket): failed to compile where S_ISSOCK is not defined.

* io.c (pipe_open): failed to compile where socketpair is not supported.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-11-11 11:08:17 +00:00
parent 52486197bc
commit f69091fabc
4 changed files with 29 additions and 8 deletions

View File

@ -1,3 +1,12 @@
Fri Nov 11 19:53:47 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* eval.c, intern.h: failed to compile where NFDBITS is defined but
howmany() is not defined. [ruby-dev:27680]
* io.c (is_socket): failed to compile where S_ISSOCK is not defined.
* io.c (pipe_open): failed to compile where socketpair is not supported.
Fri Nov 11 08:20:56 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (OUTFLAG): keep trailing spaces. [ruby-dev:27666]

2
eval.c
View File

@ -9546,7 +9546,7 @@ enum thread_status {
# endif
#endif
#ifdef NFDBITS
#if defined(NFDBITS) && defined(howmany)
void
rb_fd_init(fds)
volatile rb_fdset_t *fds;

View File

@ -161,7 +161,7 @@ NORETURN(void rb_load_fail(const char*));
NORETURN(void rb_error_frozen(const char*));
void rb_check_frozen(VALUE);
/* eval.c */
#ifdef NFDBITS
#if defined(NFDBITS) && defined(howmany)
typedef struct {
int maxfd;
fd_set *fdset;

24
io.c
View File

@ -166,16 +166,28 @@ static VALUE lineno = INT2FIX(0);
}\
} while(0)
#ifndef S_ISSOCK
# ifdef _S_ISSOCK
# define S_ISSOCK(m) _S_ISSOCK(m)
# else
# ifdef _S_IFSOCK
# define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK)
# else
# ifdef S_IFSOCK
# define S_ISSOCK(m) ((m & S_IFMT) == S_IFSOCK)
# endif
# endif
# endif
#endif
#if defined(_WIN32)
#define is_socket(fd, path) rb_w32_is_socket(fd)
#elif defined(__DJGPP__)
#elif !defined(S_ISSOCK)
#define is_socket(fd, path) 0
#define shutdown(a,b) 0
#else
static int
is_socket(fd, path)
int fd;
const char *path;
is_socket(int fd, const char *path)
{
struct stat sbuf;
if (fstat(fd, &sbuf) < 0)
@ -2817,7 +2829,7 @@ pipe_open(int argc, VALUE *argv, char *mode)
int pid = 0;
OpenFile *fptr;
VALUE port, prog;
#if defined(HAVE_FORK)
#if defined(HAVE_FORK) && defined(HAVE_SOCKETPAIR)
int status;
struct popen_arg arg;
volatile int doexec;
@ -2835,7 +2847,7 @@ pipe_open(int argc, VALUE *argv, char *mode)
prog = argv[0];
}
#if defined(HAVE_FORK)
#if defined(HAVE_FORK) && defined(HAVE_SOCKETPAIR)
cmd = StringValueCStr(prog);
doexec = (strcmp("-", cmd) != 0);
if (!doexec) {