* configure.in (os2-emx): renamed from os2_emx, add flags to

CFLAGS and LDFLAGS, and remove lib prefix.  [ruby-dev:20993]

* file.c (rb_file_s_rename): retry with removing new file on
  DOSISH.  [ruby-dev:21007]

* ext/socket/extconf.rb (sendmsg, recvmsg): check functions.

* ext/socket/socket.c (unix_send_io, unix_recv_io): raise
  NotImplementedError unless system calls are available.

* ext/socket/socket.c (sock_initialize): rename from sock_init()
  to get rid of conflict with OS/2 socket library.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-07-30 00:32:03 +00:00
Родитель fe13785cc6
Коммит db8874aa1b
5 изменённых файлов: 52 добавлений и 15 удалений

Просмотреть файл

@ -1,3 +1,19 @@
Wed Jul 30 09:31:55 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* configure.in (os2-emx): renamed from os2_emx, add flags to
CFLAGS and LDFLAGS, and remove lib prefix. [ruby-dev:20993]
* file.c (rb_file_s_rename): retry with removing new file on
DOSISH. [ruby-dev:21007]
* ext/socket/extconf.rb (sendmsg, recvmsg): check functions.
* ext/socket/socket.c (unix_send_io, unix_recv_io): raise
NotImplementedError unless system calls are available.
* ext/socket/socket.c (sock_initialize): rename from sock_init()
to get rid of conflict with OS/2 socket library.
Wed Jul 30 02:37:12 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* marshal.c (w_object): if object responds to 'marshal_dump',

Просмотреть файл

@ -288,7 +288,7 @@ mingw*) LIBS="-lwsock32 $LIBS"
ac_cv_func_telldir=yes
ac_cv_lib_crypt_crypt=no
;;
os2_emx*) LIBS="-lm $LIBS"
os2-emx*) LIBS="-lm $LIBS"
ac_cv_lib_dir_opendir=no;;
msdosdjgpp*) LIBS="-lm $LIBS"
ac_cv_func_getpgrp_void=yes;;
@ -866,6 +866,8 @@ if test "$with_dln_a_out" != yes; then
hiuxmpp) LDSHARED='ld -r' ;;
atheos*) LDSHARED="$CC -shared"
rb_cv_dlopen=yes ;;
os2-emx*) LDFLAGS="$LDFLAGS -Zbsd-signals"
;;
*) LDSHARED='ld' ;;
esac
AC_MSG_RESULT($rb_cv_dlopen)
@ -913,7 +915,7 @@ else
AC_DEFINE(DLEXT, ".bundle");;
darwin*) DLEXT=bundle
AC_DEFINE(DLEXT, ".bundle");;
os2_emx*) DLEXT=dll
os2-emx*) DLEXT=dll
AC_DEFINE(DLEXT, ".dll");;
cygwin*|mingw*) DLEXT=so
AC_DEFINE(DLEXT, ".so")
@ -1006,7 +1008,7 @@ rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no
setup=Setup.x68
;;
dnl OS/2 environment w/ Autoconf 2.1x for EMX
os2_emx)
os2-emx)
AC_LIBOBJ([os2])
setup=Setup.emx
;;
@ -1046,7 +1048,7 @@ LIBRUBYARG='$(LIBRUBYARG_STATIC)'
SOLIBS=
case "$target_os" in
cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2_emx*)
cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
DLDLIBS=""
;;
*)
@ -1167,8 +1169,11 @@ case "$target_os" in
darwin*)
CFLAGS="$CFLAGS -pipe"
;;
os2_emx)
CFLAGS="$CFLAGS -DOS2"
os2-emx)
CFLAGS="$CFLAGS -DOS2 -Zmts"
LIBRUBY_A=`echo $LIBRUBY_A | sed 's/^lib//'`
LIBRUBY_SO=`echo $LIBRUBY_SO | sed 's/^lib//'`
LIBRUBY_ALIASES=`for i in $LIBRUBY_ALIASES; do echo "$i"; done | sed 's/^lib//'`
;;
osf*)
if test "$GCC" != "yes" ; then
@ -1279,7 +1284,7 @@ case "$target_os" in
;;
esac
case "$target_os" in
cygwin*|mingw*|*djgpp*|os2_emx*)
cygwin*|mingw*|*djgpp*|os2-emx*)
RUBY_LIB_PREFIX="/lib/ruby"
;;
*)
@ -1294,7 +1299,7 @@ AC_ARG_WITH(sitedir,
[sitedir='${prefix}/lib/ruby/site_ruby'])
SITE_DIR="`eval \"echo ${sitedir}\"`"
case "$target_os" in
cygwin*|mingw*|*djgpp*|os2_emx*)
cygwin*|mingw*|*djgpp*|os2-emx*)
RUBY_SITE_LIB_PATH="`expr "$SITE_DIR" : "$prefix\(/.*\)"`" ||
RUBY_SITE_LIB_PATH="$SITE_DIR";;
*)

Просмотреть файл

@ -194,8 +194,10 @@ end
have_header("netinet/tcp.h") if not /cygwin/ =~ RUBY_PLATFORM # for cygwin 1.1.5
have_header("netinet/udp.h")
have_struct_member('struct msghdr', 'msg_control', header=['sys/types.h', 'sys/socket.h'])
have_struct_member('struct msghdr', 'msg_accrights', header=['sys/types.h', 'sys/socket.h'])
if have_func("sendmsg") or have_func("recvmsg")
have_struct_member('struct msghdr', 'msg_control', header=['sys/types.h', 'sys/socket.h'])
have_struct_member('struct msghdr', 'msg_accrights', header=['sys/types.h', 'sys/socket.h'])
end
$getaddr_info_ok = false
if !enable_config("wide-getaddrinfo", false) and try_run(<<EOF)

Просмотреть файл

@ -1508,7 +1508,7 @@ static VALUE
unix_send_io(sock, val)
VALUE sock, val;
{
#if defined(HAVE_ST_MSG_CONTROL) || defined(HAVE_ST_MSG_ACCRIGHTS)
#if defined(HAVE_SENDMSG) && (defined(HAVE_ST_MSG_CONTROL) || defined(HAVE_ST_MSG_ACCRIGHTS))
int fd;
OpenFile *fptr;
struct msghdr msg;
@ -1574,7 +1574,7 @@ unix_recv_io(argc, argv, sock)
VALUE *argv;
VALUE sock;
{
#if defined(HAVE_ST_MSG_CONTROL) || defined(HAVE_ST_MSG_ACCRIGHTS)
#if defined(HAVE_RECVMSG) && (defined(HAVE_ST_MSG_CONTROL) || defined(HAVE_ST_MSG_ACCRIGHTS))
VALUE klass, mode;
OpenFile *fptr;
struct msghdr msg;
@ -1817,7 +1817,7 @@ setup_domain_and_type(domain, dv, type, tv)
}
static VALUE
sock_init(sock, domain, type, protocol)
sock_initialize(sock, domain, type, protocol)
VALUE sock, domain, type, protocol;
{
int fd;
@ -2483,7 +2483,7 @@ Init_socket()
rb_cSocket = rb_define_class("Socket", rb_cBasicSocket);
rb_define_method(rb_cSocket, "initialize", sock_init, 3);
rb_define_method(rb_cSocket, "initialize", sock_initialize, 3);
rb_define_method(rb_cSocket, "connect", sock_connect, 1);
rb_define_method(rb_cSocket, "bind", sock_bind, 1);
rb_define_method(rb_cSocket, "listen", sock_listen, 1);

16
file.c
Просмотреть файл

@ -1333,13 +1333,27 @@ static VALUE
rb_file_s_rename(klass, from, to)
VALUE klass, from, to;
{
const char *src, *dst;
SafeStringValue(from);
SafeStringValue(to);
if (rename(StringValueCStr(from), StringValueCStr(to)) < 0) {
src = StringValueCStr(from);
dst = StringValueCStr(to);
if (rename(src, dst) < 0) {
#if defined __CYGWIN__
extern unsigned long __attribute__((stdcall)) GetLastError();
errno = GetLastError(); /* This is a Cygwin bug */
#elif defined DOSISH && !defined _WIN32
if (errno == EEXIST
#if defined (__EMX__)
|| errno == EACCES
#endif
) {
if (chmod(dst, 0666) == 0 &&
unlink(dst) == 0 &&
rename(src, dst) == 0)
return INT2FIX(0);
}
#endif
sys_fail2(from, to);
}