summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-06 12:20:29 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-06 12:20:29 +0000
commit55f6cccecea405e8b18fe83b0707219bff3483cd (patch)
tree1311dd4ae46dcdc56def21b5f92bfcfd1a76b5ce
parent651a65fe6cffb471c8200540a6154a8ffd1af652 (diff)
downloadruby-55f6cccecea405e8b18fe83b0707219bff3483cd.tar.gz
ruby-55f6cccecea405e8b18fe83b0707219bff3483cd.tar.xz
ruby-55f6cccecea405e8b18fe83b0707219bff3483cd.zip
* io.c (is_socket): fix typos. [ruby-core:03900]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--io.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index df6f2580f..c0b1d6c60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Dec 6 21:19:40 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (is_socket): fix typos. [ruby-core:03900]
+
Mon Dec 6 20:13:28 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* io.c (is_socket): new function.
diff --git a/io.c b/io.c
index 4edae5417..4bb3e368c 100644
--- a/io.c
+++ b/io.c
@@ -138,14 +138,16 @@ static VALUE lineno = INT2FIX(0);
} while(0)
#if defined(_WIN32)
-#define is_socket(fd) rb_w32_is_socket(fd)
+#define is_socket(fd, path) rb_w32_is_socket(fd)
#else
static int
-is_socket(fd)
+is_socket(fd, path)
int fd;
+ const char *path;
{
- if (fstat(fptr->fd, &sbuf) < 0)
- rb_sys_fail(fptr->path);
+ struct stat sbuf;
+ if (fstat(fd, &sbuf) < 0)
+ rb_sys_fail(path);
return S_ISSOCK(sbuf.st_mode);
}
#endif
@@ -2084,7 +2086,7 @@ rb_io_close_read(io)
rb_raise(rb_eSecurityError, "Insecure: can't close");
}
GetOpenFile(io, fptr);
- if (is_socket(fptr->fd)) {
+ if (is_socket(fptr->fd, fptr->path)) {
if (shutdown(fptr->fd, 0) < 0)
rb_sys_fail(fptr->path);
fptr->mode &= ~FMODE_READABLE;
@@ -2127,7 +2129,7 @@ rb_io_close_write(io)
rb_raise(rb_eSecurityError, "Insecure: can't close");
}
GetOpenFile(io, fptr);
- if (is_socket(fptr->fd)) {
+ if (is_socket(fptr->fd, fptr->path)) {
if (shutdown(fptr->fd, 1) < 0)
rb_sys_fail(fptr->path);
fptr->mode &= ~FMODE_WRITABLE;