ruby-changes:13558
From: usa <ko1@a...>
Date: Thu, 15 Oct 2009 09:29:22 +0900 (JST)
Subject: [ruby-changes:13558] Ruby:r25339 (trunk): * ext/socket/init.c (rsock_init_sock): mswin doesn't have S_IFSOCK
usa 2009-10-15 09:29:10 +0900 (Thu, 15 Oct 2009) New Revision: 25339 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25339 Log: * ext/socket/init.c (rsock_init_sock): mswin doesn't have S_IFSOCK flag in st_mode of struct stat. so, use rb_w32_issocket() function instead of S_ISSOCK macro. Modified files: trunk/ChangeLog trunk/ext/socket/init.c Index: ChangeLog =================================================================== --- ChangeLog (revision 25338) +++ ChangeLog (revision 25339) @@ -1,3 +1,9 @@ +Thu Oct 15 09:25:07 2009 NAKAMURA Usaku <usa@r...> + + * ext/socket/init.c (rsock_init_sock): mswin doesn't have S_IFSOCK + flag in st_mode of struct stat. so, use rb_w32_issocket() function + instead of S_ISSOCK macro. + Thu Oct 15 00:47:42 2009 NARUSE, Yui <naruse@r...> * tool/enc-unicode.rb, Index: ext/socket/init.c =================================================================== --- ext/socket/init.c (revision 25338) +++ ext/socket/init.c (revision 25339) @@ -45,10 +45,15 @@ rb_io_t *fp; struct stat sbuf; +#ifndef _WIN32 if (fstat(fd, &sbuf) < 0) rb_sys_fail(0); if (!S_ISSOCK(sbuf.st_mode)) rb_raise(rb_eArgError, "not a socket file descriptor"); +#else + if (!rb_w32_is_socket(fd)) + rb_raise(rb_eArgError, "not a socket file descriptor"); +#endif MakeOpenFile(sock, fp); fp->fd = fd; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/