kgio 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/.document CHANGED
@@ -6,4 +6,8 @@ ChangeLog
6
6
  ISSUES
7
7
  HACKING
8
8
  lib
9
+ ext/kgio/accept.c
10
+ ext/kgio/connect.c
9
11
  ext/kgio/kgio_ext.c
12
+ ext/kgio/read_write.c
13
+ ext/kgio/wait.c
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v1.2.0.GIT
4
+ DEF_VER=v1.2.1.GIT
5
5
 
6
6
  LF='
7
7
  '
@@ -155,7 +155,7 @@ ext := ext/kgio/kgio_ext.$(DLEXT)
155
155
  ext/kgio/Makefile: ext/kgio/extconf.rb
156
156
  cd $(@D) && $(RUBY) extconf.rb
157
157
 
158
- $(ext): ext/kgio/kgio_ext.c ext/kgio/Makefile
158
+ $(ext): $(wildcard ext/kgio/*.[ch] ext/kgio/*/*.h) ext/kgio/Makefile
159
159
  $(MAKE) -C $(@D)
160
160
 
161
161
  all:: test
@@ -283,7 +283,7 @@ static VALUE get_nonblock(VALUE mod)
283
283
  * call-seq:
284
284
  *
285
285
  * Kgio.accept_cloexec = true
286
- * Kgio.accept_clocexec = false
286
+ * Kgio.accept_cloexec = false
287
287
  *
288
288
  * Sets whether or not Kgio::Socket objects created by
289
289
  * TCPServer#kgio_accept,
@@ -341,9 +341,10 @@ static VALUE set_nonblock(VALUE mod, VALUE boolean)
341
341
  return Qnil;
342
342
  }
343
343
 
344
- void init_kgio_accept(VALUE mKgio)
344
+ void init_kgio_accept(void)
345
345
  {
346
346
  VALUE cUNIXServer, cTCPServer;
347
+ VALUE mKgio = rb_define_module("Kgio");
347
348
 
348
349
  localhost = rb_const_get(mKgio, rb_intern("LOCALHOST"));
349
350
  cKgio_Socket = rb_const_get(mKgio, rb_intern("Socket"));
@@ -223,8 +223,9 @@ static VALUE kgio_start(VALUE klass, VALUE addr)
223
223
  return stream_connect(klass, addr, 0);
224
224
  }
225
225
 
226
- void init_kgio_connect(VALUE mKgio)
226
+ void init_kgio_connect(void)
227
227
  {
228
+ VALUE mKgio = rb_define_module("Kgio");
228
229
  VALUE cSocket = rb_const_get(rb_cObject, rb_intern("Socket"));
229
230
  VALUE mSocketMethods = rb_const_get(mKgio, rb_intern("SocketMethods"));
230
231
  VALUE cKgio_Socket, cTCPSocket, cUNIXSocket;
@@ -29,10 +29,10 @@ struct io_args {
29
29
  int fd;
30
30
  };
31
31
 
32
- void init_kgio_wait(VALUE mKgio);
33
- void init_kgio_read_write(VALUE mKgio);
34
- void init_kgio_accept(VALUE mKgio);
35
- void init_kgio_connect(VALUE mKgio);
32
+ void init_kgio_wait(void);
33
+ void init_kgio_read_write(void);
34
+ void init_kgio_accept(void);
35
+ void init_kgio_connect(void);
36
36
 
37
37
  void kgio_wait_writable(VALUE io, int fd);
38
38
  void kgio_wait_readable(VALUE io, int fd);
@@ -2,10 +2,8 @@
2
2
 
3
3
  void Init_kgio_ext(void)
4
4
  {
5
- VALUE mKgio = rb_const_get(rb_cObject, rb_intern("Kgio"));
6
-
7
- init_kgio_wait(mKgio);
8
- init_kgio_read_write(mKgio);
9
- init_kgio_connect(mKgio);
10
- init_kgio_accept(mKgio);
5
+ init_kgio_wait();
6
+ init_kgio_read_write();
7
+ init_kgio_connect();
8
+ init_kgio_accept();
11
9
  }
@@ -33,8 +33,12 @@ accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)
33
33
  if ((flags & SOCK_NONBLOCK) == SOCK_NONBLOCK) {
34
34
  int fl = fcntl(fd, F_GETFL);
35
35
 
36
- if ((fl & O_NONBLOCK) == 0)
37
- (void)fcntl(fd, F_SETFL, fl | O_NONBLOCK);
36
+ /*
37
+ * unconditional, OSX 10.4 (and maybe other *BSDs)
38
+ * F_GETFL returns a false O_NONBLOCK with TCP sockets
39
+ * (but not UNIX sockets) [ruby-talk:274079]
40
+ */
41
+ (void)fcntl(fd, F_SETFL, fl | O_NONBLOCK);
38
42
  }
39
43
 
40
44
  /*
@@ -340,9 +340,10 @@ static VALUE kgio_trysend(VALUE io, VALUE str)
340
340
  # define kgio_trysend kgio_trywrite
341
341
  #endif /* ! USE_MSG_DONTWAIT */
342
342
 
343
- void init_kgio_read_write(VALUE mKgio)
343
+ void init_kgio_read_write(void)
344
344
  {
345
345
  VALUE mPipeMethods, mSocketMethods;
346
+ VALUE mKgio = rb_define_module("Kgio");
346
347
 
347
348
  mKgio_WaitReadable = rb_const_get(mKgio, rb_intern("WaitReadable"));
348
349
  mKgio_WaitWritable = rb_const_get(mKgio, rb_intern("WaitWritable"));
@@ -106,8 +106,10 @@ static VALUE wait_rd(VALUE mod)
106
106
  return io_wait_rd ? ID2SYM(io_wait_rd) : Qnil;
107
107
  }
108
108
 
109
- void init_kgio_wait(VALUE mKgio)
109
+ void init_kgio_wait(void)
110
110
  {
111
+ VALUE mKgio = rb_define_module("Kgio");
112
+
111
113
  rb_define_singleton_method(mKgio, "wait_readable=", set_wait_rd, 1);
112
114
  rb_define_singleton_method(mKgio, "wait_writable=", set_wait_wr, 1);
113
115
  rb_define_singleton_method(mKgio, "wait_readable", wait_rd, 0);
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kgio
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 0
10
- version: 1.2.0
9
+ - 1
10
+ version: 1.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - kgio hackers
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-05 00:00:00 +00:00
18
+ date: 2010-10-07 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -38,7 +38,11 @@ extra_rdoc_files:
38
38
  - ISSUES
39
39
  - HACKING
40
40
  - lib/kgio.rb
41
+ - ext/kgio/accept.c
42
+ - ext/kgio/connect.c
41
43
  - ext/kgio/kgio_ext.c
44
+ - ext/kgio/read_write.c
45
+ - ext/kgio/wait.c
42
46
  files:
43
47
  - .document
44
48
  - .gitignore